/* =====================================================================
   ServicesCode — Design System v2 "Editor"
   Estética: developer/editor de código (trio de marca azul/rosa/cian)
   sobre base B2B limpia. Tokens en :root, dark mode via .dark en <html>.
   Estructura:
     1. Tokens          7. Servicios       13. Contacto
     2. Base            8. Tecnologías     14. Footer
     3. Utilidades      9. Portafolio      15. To-top / Modales / Cookies
     4. Botones        10. Proceso         16. Páginas legales
     5. Header/Nav     11. Testimonios     17. Responsive
     6. Hero           12. FAQs            18. Reduced motion
   ===================================================================== */

/* 1) TOKENS ----------------------------------------------------------- */
:root {
  /* Marca (trio del logo <ServicesCode/>) */
  --blue:       #1F6FEB;
  --blue-deep:  #1456C4;   /* hover / texto azul AA sobre claro */
  --pink:       #ff79c6;   /* decorativo */
  --pink-ink:   #B02E88;   /* rosa apto para texto en claro */
  --cyan:       #8be9fd;   /* decorativo */
  --cyan-ink:   #0E7490;   /* cian apto para texto en claro */

  --grad-brand: linear-gradient(90deg, var(--blue), var(--pink) 50%, var(--cyan));
  --grad-cta:   linear-gradient(180deg, #3B82F6, #1F6FEB 60%, #1A63D6);

  /* Superficies y texto (modo claro) */
  --bg:            #ffffff;
  --bg-soft:       #f4f7fc;
  --surface:       #ffffff;
  --surface-2:     #f7fafd;
  --border:        #e4eaf3;
  --border-strong: #c9d5e6;
  --text:          #0e1a2b;
  --text-soft:     #45566e;
  --text-faint:    #5f7189;
  --ring:          #1F6FEB;

  /* Estados */
  --ok:      #1a7f37;
  --error:   #cf222e;

  /* Sombras (tinte navy, nunca negro puro) */
  --shadow-xs: 0 1px 2px rgba(14, 26, 43, .06);
  --shadow-sm: 0 2px 6px rgba(14, 26, 43, .06), 0 1px 2px rgba(14, 26, 43, .05);
  --shadow-md: 0 10px 28px -8px rgba(14, 26, 43, .14), 0 2px 6px rgba(14, 26, 43, .05);
  --shadow-lg: 0 24px 55px -18px rgba(14, 26, 43, .22), 0 4px 12px rgba(14, 26, 43, .06);
  --glow-blue: 0 10px 30px -8px rgba(31, 111, 235, .45);

  /* Tipografía */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-display: clamp(2.35rem, 1.6rem + 2.8vw, 3.55rem);
  --fs-h2:      clamp(1.7rem, 1.35rem + 1.4vw, 2.3rem);
  --fs-h3:      1.18rem;
  --fs-lead:    clamp(1.05rem, .98rem + .35vw, 1.2rem);

  /* Layout */
  --container-width: 1140px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --border-radius: 12px;           /* legacy alias */
  --section-pad: clamp(4rem, 3rem + 3.5vw, 6.25rem);
  --transition-speed: 0.25s;

  /* Aliases legacy (compatibilidad con reglas antiguas / inline) */
  --color-primary: var(--blue);
  --color-accent:  var(--cyan-ink);
  --color-dark:    var(--text);
  --color-light:   var(--bg-soft);
  --color-white:   #ffffff;
  --color-gray:    var(--text-faint);
  --color-success: var(--ok);
  --color-error:   var(--error);
  --brand:  var(--blue);
  --brand2: var(--cyan-ink);
  --neutral-900: #0e1a2b;
  --neutral-700: #45566e;
  --neutral-400: #94A3B8;
  --neutral-100: #F1F5F9;

  color-scheme: light;
}

.dark {
  --bg:            #0a0f1c;
  --bg-soft:       #0d1526;
  --surface:       #121a2e;
  --surface-2:     #0f1626;
  --border:        #223050;
  --border-strong: #33456e;
  --text:          #e7edf8;
  --text-soft:     #a9b7cf;
  --text-faint:    #8393ad;
  --ring:          #8be9fd;

  --blue-deep: #6ea8ff;            /* “azul de texto” legible en oscuro */
  --pink-ink:  #ff9ad5;
  --cyan-ink:  #7cd7ec;

  --ok:    #3fb950;
  --error: #f97583;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-md: 0 12px 30px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 28px 60px -18px rgba(0, 0, 0, .65);
  --glow-blue: 0 10px 32px -8px rgba(31, 111, 235, .55);

  --color-gray: var(--text-faint);
  --color-light: var(--bg-soft);

  color-scheme: dark;
}

/* 2) BASE -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 92px;        /* anclas bajo el header sticky */
  background: var(--bg);
}

body {
  font-family: var(--font-family);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -0.02em; font-weight: 700; color: var(--text); }
b, strong { font-weight: 650; }

a { color: var(--blue-deep); }

::selection { background: rgba(31, 111, 235, .22); }
.dark ::selection { background: rgba(139, 233, 253, .28); color: #fff; }

/* Skip link (accesibilidad) */
.skip-link {
  position: absolute;
  top: -48px; left: 12px;
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  z-index: 3000;
  text-decoration: none;
  font-weight: 650;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  transition: top .25s ease;
}
.skip-link:focus { top: 12px; }
.dark .skip-link { background: var(--cyan); color: #0a0f1c; }

/* Focus visible global — anillo de marca, nunca lo elimines */
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* 3) UTILIDADES -------------------------------------------------------- */
.container { max-width: var(--container-width); margin-inline: auto; padding: 0 1.25rem; }

.section { padding: var(--section-pad) 0; }

/* Secciones alternas: lienzo frío con retícula de puntos (blueprint sutil) */
.section--light, .section--alt {
  background-color: var(--bg-soft);
  background-image: radial-gradient(circle, rgba(14, 26, 43, .055) 1px, transparent 1.5px);
  background-size: 26px 26px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dark .section--light, .dark .section--alt {
  background-color: var(--bg-soft);
  background-image: radial-gradient(circle, rgba(139, 233, 253, .05) 1px, transparent 1.5px);
}

.section__title {
  font-size: var(--fs-h2);
  font-weight: 760;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 2.9rem;
  text-wrap: balance;
}
/* Subrayado firma: barra degradada con el trio de marca */
.section__title::after {
  content: "";
  display: block;
  width: 64px; height: 4px;
  margin: .95rem auto 0;
  border-radius: 999px;
  background: var(--grad-brand);
}

.subtitle {
  font-size: var(--fs-lead);
  color: var(--text-soft);
  max-width: 620px;
  margin: 0 auto 2rem;
}
.section__title + .subtitle {
  margin-top: -1.9rem;
  margin-bottom: 2.6rem;
  text-align: center;
}

/* Notas “comentario de código” (services__note, tech__note) */
.services__note, .tech__note {
  text-align: center;
  margin-top: 2.4rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: .875rem;
}

/* Visually-hidden */
.sr {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Chips base (.badge — trust badges, stack tags, case meta) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: .45rem 1rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.4;
}
.dark .badge {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .1);
  color: var(--text-soft);
}

/* 4) BOTONES ----------------------------------------------------------- */
.button {
  display: inline-block;
  padding: .8rem 1.7rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: .01em;
  line-height: 1.4;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
}

.button--primary {
  background: var(--grad-cta);
  color: #fff;
  box-shadow: 0 1px 2px rgba(14, 26, 43, .2), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.button--primary:hover, .button--primary:focus-visible {
  background: linear-gradient(180deg, #2E77F2, #1A63D6 60%, #1456C4);
  transform: translateY(-2px);
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.button--primary:active { transform: translateY(0); }

.button--secondary {
  background: transparent;
  color: var(--blue-deep);
  border-color: rgba(31, 111, 235, .45);
}
.button--secondary:hover, .button--secondary:focus-visible {
  background: rgba(31, 111, 235, .09);
  border-color: var(--blue);
  color: var(--blue-deep);
  transform: translateY(-2px);
}
.dark .button--secondary {
  color: #9ec5ff;
  border-color: rgba(110, 168, 255, .45);
}
.dark .button--secondary:hover, .dark .button--secondary:focus-visible {
  background: rgba(31, 111, 235, .22);
  border-color: #6ea8ff;
  color: #cfe1ff;
}

.button--small { padding: .55rem 1.05rem; font-size: .9rem; border-radius: 9px; }

/* 5) HEADER & NAVEGACIÓN ----------------------------------------------- */
/* El inline <style> de index.html pone sticky+blur en <header>; estas
   reglas de clase lo pisan/completan en ambos temas. */
.header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(14, 26, 43, .08);
}
/* Hairline superior firma con el trio de marca */
.header::before {
  content: "";
  display: block;
  height: 2px;
  background: var(--grad-brand);
  opacity: .9;
}
.dark .header {
  background: rgba(10, 15, 26, .78);
  border-bottom-color: rgba(255, 255, 255, .08);
}
/* Alias legacy del index (.g3-header) — mismo tratamiento */
.g3-header { background: rgba(255, 255, 255, .82); }
.dark .g3-header { background: rgba(10, 15, 26, .78); border-color: rgba(255, 255, 255, .08); }

.nav { display: flex; justify-content: space-between; align-items: center; height: 70px; gap: 1rem; }

.nav__logo {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 1.2rem;
  color: var(--text);
}
.nav__logo svg, .nav__logo img { display: block; height: 34px; width: auto; }
.nav__logo .brand-icon { color: var(--pink); font-weight: 800; }

.nav__menu { list-style: none; display: none; gap: .15rem; align-items: center; }
.nav__menu a {
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 600;
  font-size: .95rem;
  padding: .5rem .85rem;
  border-radius: 9px;
  transition: background var(--transition-speed), color var(--transition-speed);
}
.nav__menu a:hover, .nav__menu a:focus-visible {
  color: var(--blue-deep);
  background: rgba(31, 111, 235, .08);
}
.dark .nav__menu a { color: var(--text-soft); }
.dark .nav__menu a:hover, .dark .nav__menu a:focus-visible {
  color: #cfe1ff;
  background: rgba(110, 168, 255, .12);
}

.nav__controls { display: flex; align-items: center; gap: .5rem; }

/* Select de idioma — chip con chevron propio (appearance:none) */
.nav__lang-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  height: 38px;
  padding: 0 1.7rem 0 .8rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235f7189' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  font-family: var(--font-mono);
  font-weight: 700; font-size: .85rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  transition: border-color var(--transition-speed);
}
.nav__lang-select:hover { border-color: var(--blue); }
.dark .nav__lang-select {
  background-color: rgba(255, 255, 255, .04);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a9b7cf' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color: var(--text);
  border-color: var(--border-strong);
}
.dark .nav__lang-select:hover { border-color: #6ea8ff; }
.nav__lang-select option { color: #0e1a2b; background: #fff; }
.dark .nav__lang-select option { color: #e7edf8; background: #121a2e; }

/* Toggle de tema — se sustituye el emoji por glifos ☾ / ☀ (texto, no emoji) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: transform .18s ease, border-color var(--transition-speed), color var(--transition-speed), background var(--transition-speed);
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--blue); color: var(--blue-deep); }
.dark .theme-toggle { background: rgba(255, 255, 255, .04); border-color: var(--border-strong); color: var(--text-soft); }
.dark .theme-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

.theme-toggle .theme-icon { font-size: 0; line-height: 0; }
.theme-toggle .theme-icon::before {
  content: "\263E\FE0E";           /* luna: “pasar a oscuro” */
  font-size: 1.05rem;
  line-height: 1;
}
.dark .theme-toggle .theme-icon::before {
  content: "\2600\FE0E";           /* sol: “pasar a claro” */
}

/* Hamburguesa */
.nav__mobile-toggle {
  display: inline-flex; gap: 4px; flex-direction: column; justify-content: center;
  width: 44px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
}
.nav__mobile-toggle span {
  display: block; height: 2px; width: 20px;
  margin: 0 auto; border-radius: 2px;
  background: var(--text);
}
.dark .nav__mobile-toggle { background: rgba(255, 255, 255, .04); }

/* 6) HERO --------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 4.5rem 0 5rem;
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  /* Lienzo: degradado frío + glows del trio de marca */
  background:
    radial-gradient(56rem 32rem at 10% -10%, rgba(31, 111, 235, .09), transparent 60%),
    radial-gradient(42rem 30rem at 92% 8%, rgba(139, 233, 253, .16), transparent 62%),
    radial-gradient(38rem 30rem at 78% 105%, rgba(255, 121, 198, .09), transparent 60%),
    linear-gradient(180deg, #fbfcff, #f1f6fc);
}
.dark .hero {
  background:
    radial-gradient(56rem 32rem at 10% -10%, rgba(31, 111, 235, .2), transparent 60%),
    radial-gradient(42rem 30rem at 92% 8%, rgba(139, 233, 253, .08), transparent 62%),
    radial-gradient(38rem 30rem at 78% 105%, rgba(255, 121, 198, .1), transparent 60%),
    linear-gradient(180deg, #0d1424, #0a0f1c);
}

/* Glifos de código flotantes (decorativos, en monospace).
   Nota: el glifo vive en el ::before de cada span .decorN — `content`
   sobre el elemento real no renderiza. --r alimenta la rotación de floaty. */
.hero::before, .hero::after,
.hero .decor1::before, .hero .decor2::before, .hero .decor3::before {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  animation: floaty 18s ease-in-out infinite;
}
.hero .decor1, .hero .decor2, .hero .decor3 { position: static; }

.hero::before {
  content: "{}";
  top: 10%; left: 4%;
  font-size: 96px;
  --r: -10deg;
  color: rgba(31, 111, 235, .08);
}
.hero::after {
  content: "</>";
  top: 16%; right: 6%;
  font-size: 110px;
  --r: 6deg;
  animation-delay: 3s;
  color: rgba(255, 121, 198, .1);
}
.hero .decor1::before {
  content: "[]";
  bottom: 12%; left: 12%;
  font-size: 84px;
  --r: -5deg;
  animation-delay: 6s;
  color: rgba(14, 116, 144, .1);
}
.hero .decor2::before {
  content: "::";
  bottom: 16%; right: 20%;
  font-size: 120px;
  --r: 14deg;
  animation-delay: 9s;
  color: rgba(31, 111, 235, .07);
}
.hero .decor3::before {
  content: ";";
  top: 42%; left: 44%;
  font-size: 72px;
  --r: -18deg;
  animation-delay: 12s;
  color: rgba(255, 121, 198, .08);
}
.dark .hero::before  { color: rgba(110, 168, 255, .07); }
.dark .hero::after   { color: rgba(255, 121, 198, .08); }
.dark .hero .decor1::before { color: rgba(139, 233, 253, .07); }
.dark .hero .decor2::before { color: rgba(110, 168, 255, .06); }
.dark .hero .decor3::before { color: rgba(255, 121, 198, .06); }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-16px) rotate(calc(var(--r, 0deg) + 4deg)); }
}

.hero__content {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  position: relative;
  z-index: 1;
}

.hero__text { display: flex; flex-direction: column; gap: 1.4rem; align-items: flex-start; }

.hero h1 {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.032em;
  text-wrap: balance;
  color: var(--text);
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero h1 {
    background: linear-gradient(115deg, var(--text) 0%, var(--text) 52%, #1F6FEB 82%, #0E7490 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--text); /* fallback si el clip falla */
  }
  .dark .hero h1 {
    background: linear-gradient(115deg, #f4f8ff 0%, #dbe7ff 46%, #8be9fd 80%, #ff9ad5 104%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.hero .subtitle { margin: 0; max-width: 34rem; }

/* Bullets del hero (el <ul> no lleva clase: se inyectan <li> via i18n) */
.hero__text ul, .hero__bullets {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.hero__text ul li, .hero__bullets li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  color: var(--text-soft);
  font-weight: 500;
}
.hero__text ul li::before, .hero__bullets li::before {
  content: "✓";
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin-top: .1em;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(31, 111, 235, .12);
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
}
.dark .hero__text ul li::before, .dark .hero__bullets li::before {
  background: rgba(139, 233, 253, .14);
  color: var(--cyan);
}

.hero__cta { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .35rem; }

/* Ventana de código — pieza central de identidad (oscura en ambos temas) */
.hero__visual {
  display: flex; justify-content: flex-end; align-items: center;
  position: relative;
  isolation: isolate;
}
/* Halo de color detrás de la ventana */
.hero__visual::before {
  content: "";
  position: absolute;
  inset: 6% -4% -2% 8%;
  z-index: -1;
  background:
    radial-gradient(closest-side, rgba(31, 111, 235, .3), transparent 72%) left 20% top 20% / 75% 75% no-repeat,
    radial-gradient(closest-side, rgba(255, 121, 198, .22), transparent 72%) right 10% bottom 12% / 62% 62% no-repeat;
  filter: blur(30px);
  opacity: .7;
}
.dark .hero__visual::before { opacity: 1; }

.code-window {
  width: 100%; max-width: 540px;
  background: #0d1424;
  border-radius: 16px;
  border: 1px solid rgba(139, 233, 253, .14);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  box-shadow:
    0 40px 80px -28px rgba(4, 10, 24, .55),
    0 0 0 1px rgba(10, 15, 28, .5),
    0 0 90px -32px rgba(31, 111, 235, .55);
}
.code-window__topbar {
  height: 40px;
  background: rgba(255, 255, 255, .035);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.dot--red { background: #ff5f57; } .dot--yellow { background: #ffbd2e; } .dot--green { background: #28ca42; }

.code-window__content {
  font-family: var(--font-mono);
  font-size: 14px; line-height: 1.7;
  color: #dbe4f5;
  padding: 18px 20px;
  min-height: 220px;
  white-space: pre-wrap; word-break: break-word; tab-size: 2;
  text-align: left;      /* inmune al text-align:center del hero apilado */
}
/* Sintaxis (paleta Dracula, coherente con el logo) */
.kw  { color: #ff79c6; }
.fn  { color: #8be9fd; }
.str { color: #f1fa8c; }
.com { color: #7b8bab; }

.code-window ::selection { background: rgba(139, 233, 253, .3); color: #fff; }

.cursor { display: inline-block; margin-left: 2px; color: #8be9fd; animation: sc-blink 1s step-start infinite; }
@keyframes sc-blink { 50% { opacity: 0; } }

/* 7) TRUST BADGES -------------------------------------------------------- */
.trust-badges {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .75rem;
  padding-top: 2.4rem;
  padding-bottom: 3.4rem;
}
/* “Status chips”: punto de color por badge, ciclo del trio + verde */
.trust-badges .badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.trust-badges .badge:nth-child(4n+1)::before { background: var(--blue); }
.trust-badges .badge:nth-child(4n+2)::before { background: #ec4899; }
.trust-badges .badge:nth-child(4n+3)::before { background: #06b6d4; }
.trust-badges .badge:nth-child(4n+4)::before { background: #22c55e; }

/* 8) SERVICES ------------------------------------------------------------ */
.services__grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

.service-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.9rem 1.75rem 1.75rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.dark .service-card { background: var(--surface); border-color: var(--border); }

/* Barrido de luz por el borde superior (identidad conservada, ahora en trio) */
.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--blue) 35%, var(--cyan) 55%, var(--pink) 70%, transparent);
  transition: left .9s cubic-bezier(0.3, 1, 0.7, 1);
}
.service-card:hover::before { left: 100%; }

/* Lavado de color sutil al hover */
.service-card::after {
  content: "";
  position: absolute;
  inset: 0 0 55% 0;
  background: radial-gradient(120% 100% at 50% -30%, rgba(31, 111, 235, .07), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.service-card:hover::after { opacity: 1; }

.service-card:hover {
  transform: translateY(-5px);
  border-color: rgba(31, 111, 235, .45);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(31, 111, 235, .12);
}
.dark .service-card:hover {
  border-color: rgba(110, 168, 255, .4);
  box-shadow: var(--shadow-md), 0 0 30px -12px rgba(31, 111, 235, .45);
}

.service-card h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-bottom: .55rem;
}
.service-card p { color: var(--text-soft); font-size: .96rem; }
.dark .service-card h3 { color: var(--text); }
.dark .service-card p  { color: var(--text-soft); }

/* Enlace “ver detalles” — subrayado que crece (estado final visible sin motion) */
.service-card__link {
  display: inline-block;
  margin-top: .9rem;
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 650;
  font-size: .93rem;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size .25s ease, color .2s ease;
}
.service-card__link:hover, .service-card__link:focus-visible { background-size: 100% 2px; }
.dark .service-card__link { color: var(--cyan); }

/* 9) TECHNOLOGIES --------------------------------------------------------- */
.tech__grid { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.tech__item {
  display: flex; align-items: center; gap: .55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .55rem 1.05rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .92rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease;
}
.tech__item:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 235, .5);
  box-shadow: var(--shadow-sm);
}
.tech__item img { height: 22px; width: 22px; }
.dark .tech__item {
  background: rgba(255, 255, 255, .04);
  border-color: var(--border);
  color: var(--text);
}
.dark .tech__item:hover { border-color: rgba(139, 233, 253, .45); }
.dark .tech__item img { filter: brightness(0) invert(1); opacity: .85; }

/* 10) PORTFOLIO ------------------------------------------------------------ */
.portfolio__filters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem;
  margin-bottom: 2.4rem;
}
.filter-btn, .copy-link-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  padding: .5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: background var(--transition-speed), color var(--transition-speed),
              border-color var(--transition-speed), box-shadow var(--transition-speed);
}
.filter-btn:hover {
  border-color: var(--blue);
  color: var(--blue-deep);
  background: rgba(31, 111, 235, .07);
}
.filter-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 4px 14px -4px rgba(31, 111, 235, .55);
}
.copy-link-btn { border-color: rgba(14, 116, 144, .5); color: var(--cyan-ink); }
.copy-link-btn:hover, .copy-link-btn:focus-visible {
  background: var(--cyan-ink);
  border-color: var(--cyan-ink);
  color: #fff;
}
.dark .filter-btn { border-color: var(--border-strong); color: var(--text-soft); }
.dark .filter-btn:hover { border-color: #6ea8ff; color: #cfe1ff; background: rgba(110, 168, 255, .1); }
.dark .filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 16px -4px rgba(31, 111, 235, .6);
}
.dark .copy-link-btn { border-color: rgba(139, 233, 253, .4); color: var(--cyan); }
.dark .copy-link-btn:hover, .dark .copy-link-btn:focus-visible {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #0a0f1c;
}

.portfolio__grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }

.portfolio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  display: none;               /* el JS de filtros la muestra con .show */
}
.portfolio-card.show { display: block; }
.portfolio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(31, 111, 235, .4);
  box-shadow: var(--shadow-md);
}
.dark .portfolio-card { background: var(--surface); border-color: var(--border); }
.dark .portfolio-card:hover {
  border-color: rgba(110, 168, 255, .38);
  box-shadow: var(--shadow-md), 0 0 30px -14px rgba(31, 111, 235, .4);
}

.portfolio-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.portfolio-card:hover .portfolio-card__image { transform: scale(1.035); }
/* Contener el zoom de la imagen */
.portfolio-card { isolation: isolate; }

.portfolio-card__content { padding: 1.5rem 1.5rem 1.6rem; }
.portfolio-card h3 { font-size: 1.18rem; margin-bottom: .2rem; }
.portfolio-card__sector {
  display: block;
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .9rem;
}
.portfolio-card__results {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
  color: var(--text-soft);
  font-size: .94rem;
}
.portfolio-card__results li { position: relative; padding-left: 1.35rem; margin-bottom: .3rem; }
.portfolio-card__results li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--ok);
  font-family: var(--font-mono);
  font-weight: 700;
}
.portfolio-card__stack { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.35rem; }
.portfolio-card__stack span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: .22rem .55rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: .74rem;
}
.dark .portfolio-card__stack span {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .1);
}
.portfolio-card .button { font-size: .9rem; }
.dark .portfolio-card h3 { color: var(--text); }
.dark .portfolio-card__results { color: var(--text-soft); }

/* 11) PROCESS ---------------------------------------------------------------- */
.process__timeline { position: relative; max-width: 820px; margin: 0 auto; }
/* Vertebra: línea degradada con el trio */
.process__timeline::after {
  content: "";
  position: absolute;
  width: 2px;
  top: 8px; bottom: 8px; left: 21px;
  border-radius: 2px;
  background: linear-gradient(180deg,
    rgba(31, 111, 235, .85),
    rgba(14, 116, 144, .6) 55%,
    rgba(236, 72, 153, .55));
}
.dark .process__timeline::after {
  background: linear-gradient(180deg,
    rgba(110, 168, 255, .8),
    rgba(139, 233, 253, .5) 55%,
    rgba(255, 121, 198, .5));
}

.process__item { padding: .7rem 0 .7rem 66px; position: relative; }

/* Nodo numerado — chip degradado con anillo que “corta” la línea */
.process__item::before {
  content: attr(data-step);
  position: absolute; left: 0; top: .8rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #0E7490);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  z-index: 1;
  box-shadow: 0 0 0 5px var(--bg-soft), 0 8px 18px -6px rgba(31, 111, 235, .5);
}

/* El título es la tarjeta */
.process__item h3 {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.25rem;
  font-size: 1.03rem;
  font-weight: 650;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.process__item:hover h3 {
  border-color: rgba(31, 111, 235, .45);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.dark .process__item h3 { background: var(--surface); border-color: var(--border); }
.dark .process__item:hover h3 { border-color: rgba(110, 168, 255, .4); }

/* 12) TESTIMONIALS ------------------------------------------------------------ */
.testimonials__grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.testimonial-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.9rem 1.9rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* Comilla decorativa gigante */
.testimonial-card::before {
  content: "\201C";
  position: absolute;
  top: .4rem; left: 1.1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.6rem;
  line-height: 1;
  color: rgba(31, 111, 235, .16);
  pointer-events: none;
}
.dark .testimonial-card::before { color: rgba(139, 233, 253, .13); }

.testimonial-card:hover {
  transform: translateY(-3px);
  border-color: rgba(31, 111, 235, .35);
  box-shadow: var(--shadow-md);
}
.dark .testimonial-card {
  background: var(--surface);
  border-color: var(--border);
}
.dark .testimonial-card:hover { border-color: rgba(110, 168, 255, .35); }

.testimonial-card blockquote {
  position: relative;
  margin: 0 0 1.15rem;
  color: var(--text-soft);
  font-size: .98rem;
  line-height: 1.7;
}
.testimonial-card cite { font-weight: 650; font-style: normal; color: var(--text); }
.testimonial-card cite span {
  display: block;
  font-weight: 400;
  color: var(--text-faint);
  font-size: .88rem;
  font-family: var(--font-mono);
  margin-top: .15rem;
}

/* 13) FAQS ---------------------------------------------------------------------- */
.faqs__container { max-width: 800px; }

.faqs__list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .85rem;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.faqs__list details:hover { border-color: var(--border-strong); }
.faqs__list details[open] {
  border-color: rgba(31, 111, 235, .4);
  box-shadow: var(--shadow-sm);
}
.dark .faqs__list details { background: var(--surface); border-color: var(--border); }
.dark .faqs__list details[open] { border-color: rgba(110, 168, 255, .4); }

.faqs__list summary {
  padding: 1.05rem 3.4rem 1.05rem 1.3rem;
  font-weight: 620;
  cursor: pointer;
  list-style: none;
  position: relative;
  color: var(--text);
  border-radius: var(--radius);
}
.faqs__list summary::-webkit-details-marker { display: none; }

/* Indicador +/− en chip circular */
.faqs__list summary::after {
  content: "+";
  position: absolute;
  right: .9rem; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.faqs__list details[open] summary::after {
  content: "−";
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.faqs__list details[open] summary { color: var(--blue-deep); }
.dark .faqs__list details[open] summary { color: #cfe1ff; }
.dark .faqs__list summary::after {
  background: rgba(255, 255, 255, .05);
  border-color: var(--border-strong);
  color: var(--cyan);
}
.dark .faqs__list details[open] summary::after {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.faqs__list details > div {
  padding: .85rem 1.3rem 1.15rem;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: .96rem;
}
.dark .faqs__list details > div { border-top-color: var(--border); color: var(--text-soft); }

/* 14) CONTACT --------------------------------------------------------------------- */
#contact.section {
  background: linear-gradient(180deg, transparent, rgba(31, 111, 235, .05));
}
.dark #contact.section {
  background:
    radial-gradient(52rem 26rem at 50% 120%, rgba(31, 111, 235, .16), transparent 65%),
    linear-gradient(180deg, transparent, rgba(31, 111, 235, .05));
}

.contact__container { max-width: 700px; text-align: center; }
.contact__form { display: flex; flex-direction: column; gap: 1.15rem; text-align: left; margin-top: 2.2rem; }

.form-group { display: flex; flex-direction: column; }
.form-group label {
  margin-bottom: .45rem;
  font-weight: 600;
  font-size: .92rem;
  color: var(--text);
}
.form-group input, .form-group textarea {
  padding: .8rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-faint); }
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .18);
}
.dark .form-group input, .dark .form-group textarea {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.dark .form-group input:focus, .dark .form-group textarea:focus {
  border-color: #6ea8ff;
  box-shadow: 0 0 0 3px rgba(110, 168, 255, .25);
}

/* Autofill sin “amarilleo” */
.form-group input:-webkit-autofill, .form-group textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 40px var(--surface) inset !important;
  caret-color: var(--text);
}
.dark .form-group input:-webkit-autofill, .dark .form-group textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 40px var(--surface-2) inset !important;
}

.error-message { color: var(--error); font-size: .85rem; margin-top: .35rem; }
.error-message:empty { margin: 0; }

.honeypot { display: none; }

#form-status { margin-top: 1.1rem; font-weight: 600; }
#form-status.success, #form-status.error {
  display: inline-block;
  padding: .7rem 1.2rem;
  border-radius: 10px;
  font-size: .95rem;
}
#form-status.success {
  color: var(--ok);
  background: rgba(26, 127, 55, .09);
  border: 1px solid rgba(26, 127, 55, .3);
}
#form-status.error {
  color: var(--error);
  background: rgba(207, 34, 46, .07);
  border: 1px solid rgba(207, 34, 46, .3);
}
.dark #form-status.success { background: rgba(63, 185, 80, .1); border-color: rgba(63, 185, 80, .35); }
.dark #form-status.error   { background: rgba(249, 117, 131, .1); border-color: rgba(249, 117, 131, .35); }

/* Compat: reglas antiguas apuntaban aquí */
.dark .contact__container { color: var(--text); }
.dark .contact__container .subtitle { color: var(--text-soft); }
.dark .form-group label { color: var(--text); }

/* 15) FOOTER (oscuro en AMBOS temas — ancla la página como la code window) ---- */
.footer {
  position: relative;
  background: #0b1220;
  color: #a9b7cf;
  padding: 3.5rem 0 2rem;
}
.footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: .75;
}
.dark .footer { background: #080d18; border-top: none; }

.footer__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  align-items: flex-start;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.footer__logo {
  text-decoration: none;
  color: #eef3fb;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  display: inline-flex; align-items: center; gap: .5rem;
}
.footer__logo .brand-icon, .brand-icon { font-weight: 800; color: var(--pink); }
.footer__brand p { color: #8ea0bd; margin-top: .65rem; max-width: 38ch; font-size: .95rem; }

.footer__col-title, .footer__contact h4, .footer__social h4 {
  margin-bottom: .75rem;
  font-weight: 700;
  color: #eef3fb;
  font-size: .95rem;
  letter-spacing: .02em;
}

.footer__contact p, .footer__social a {
  display: flex; align-items: center; gap: .5rem;
  margin: .3rem 0;
}
.footer__contact a, .footer__social a {
  color: #a9b7cf;
  text-decoration: none;
  transition: color .2s ease;
}
.footer__contact a:hover, .footer__contact a:focus-visible,
.footer__social a:hover, .footer__social a:focus-visible {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ico { width: 18px; height: 18px; fill: #64748b; flex: 0 0 auto; }

/* Compat legacy (.social-links ya no está en el markup vivo) */
.social-links, .social-links--stack { display: block; }
.social-links--stack a { display: flex; margin: .3rem 0; font-size: 1rem; }

.footer__bottom {
  padding-top: 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  color: #7d8ca3;
  font-size: .9rem;
}
.footer__links a { color: #8ea0bd; text-decoration: none; }
.footer__links a:hover, .footer__links a:focus-visible {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Overrides dark (heredado del bloque claro: solo matices) */
.dark .footer__bottom { border-top: none; }

/* 16) COMPONENTES FLOTANTES -------------------------------------------------- */
/* Back to top */
.to-top {
  position: fixed; right: 18px; bottom: 18px;
  width: 46px; height: 46px;
  border-radius: 999px; border: none;
  background: var(--grad-cta);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--glow-blue);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s, box-shadow .2s;
  z-index: 1200;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { box-shadow: 0 14px 34px -8px rgba(31, 111, 235, .6); transform: translateY(-2px); }

/* Modales */
.modal {
  position: fixed; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 12, 26, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 2000;
  padding: 1.5rem;
}
.modal[aria-hidden="false"] { display: flex; }
.dark .modal { background: rgba(2, 6, 18, .75); }

.modal__dialog {
  position: relative;
  background: var(--surface);
  color: var(--text);
  width: min(900px, 100%);
  max-height: 85vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid; grid-template-rows: auto 1fr;
  animation: modal-pop .2s ease-out;
}
@keyframes modal-pop { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  padding: 1.15rem 3.4rem 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.modal__header h2 { font-size: 1.2rem; letter-spacing: -0.015em; }
.modal__actions { display: flex; align-items: center; gap: .5rem; }

.modal__content { padding: 1.35rem 1.5rem 1.6rem; overflow: auto; }
.modal__content h3 { margin-top: 1.25rem; margin-bottom: .5rem; font-size: 1.05rem; }
.modal__content p, .modal__content li { color: var(--text-soft); font-size: .96rem; margin-bottom: .8rem; }
.modal__content hr { border: 0; border-top: 1px solid var(--border); margin: 1.4rem 0; }
.modal__content a { color: var(--blue-deep); }
.dark .modal__content a { color: var(--cyan); }

.modal__close {
  position: absolute; top: .8rem; right: .9rem;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  color: var(--text-faint);
  z-index: 1;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.modal__close:hover { color: var(--text); border-color: var(--blue); }

.open-new, .link-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 700;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.open-new:hover, .link-icon:hover { border-color: var(--blue); color: var(--blue-deep); background: var(--surface-2); }
.dark .open-new:hover, .dark .link-icon:hover { color: var(--cyan); border-color: rgba(139, 233, 253, .5); }

/* Scrollbar del modal (WebKit) */
.modal__content::-webkit-scrollbar { width: 12px; }
.modal__content::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 3px solid var(--surface);
}
.modal__content::-webkit-scrollbar-track { background: var(--surface); }

/* Banner de cookies */
.cookie-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 1500;
  max-width: 560px;
  margin-inline: auto;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 1.15rem 1.3rem 1.1rem;
  overflow: hidden;
}
.cookie-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
}
.dark .cookie-banner {
  background: rgba(15, 22, 38, .92);
  border-color: var(--border);
  color: var(--text);
}
.cookie-banner__text { margin: 0 0 .85rem; font-size: .92rem; line-height: 1.55; color: var(--text-soft); }
.cookie-banner__text a { color: var(--blue-deep); font-weight: 600; }
.dark .cookie-banner__text a { color: var(--cyan); }
.cookie-banner__actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* 17) PÁGINAS LEGALES / ABOUT (contenido plano en main.container.section) ----- */
main.section { max-width: 840px; }
main.section h1 {
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
  letter-spacing: -0.028em;
  margin-bottom: 1.1rem;
}
main.section h1::after {
  content: "";
  display: block;
  width: 56px; height: 4px;
  margin-top: .8rem;
  border-radius: 999px;
  background: var(--grad-brand);
}
main.section h2 { font-size: 1.35rem; margin: 2.1rem 0 .7rem; }
main.section h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
main.section p, main.section li { color: var(--text-soft); margin-bottom: .9rem; }
main.section ul, main.section ol { padding-left: 1.4rem; margin-bottom: 1rem; }
main.section a:not(.button) { color: var(--blue-deep); text-underline-offset: 3px; }
.dark main.section a:not(.button) { color: var(--cyan); }

/* 18) RESPONSIVE --------------------------------------------------------------- */
/* Móvil: menú desplegable */
@media (max-width: 767px) {
  .nav { position: relative; }
  .nav__menu {
    display: none;              /* main.js lo alterna con style.display flex/none */
    flex-direction: column;
    gap: .35rem;
    align-items: stretch;
    position: absolute;
    right: 0; top: 62px;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
  }
  .nav__menu a { display: block; padding: .6rem .8rem; border-radius: 9px; }
}

@media (min-width: 768px) {
  .nav__menu { display: flex; }
  .nav__mobile-toggle { display: none; }
}

/* Hero apilado en tablet/móvil */
@media (max-width: 1023px) {
  .hero { min-height: auto; padding: 3.4rem 0 4rem; }
  .hero__content { grid-template-columns: 1fr; text-align: center; }
  .hero__text { align-items: center; }
  .hero .subtitle { margin-inline: auto; }
  .hero__text ul li, .hero__bullets li { text-align: left; }
  .hero__cta { justify-content: center; }
  .hero__visual { justify-content: center; margin-top: 1.5rem; }
  .code-window { max-width: 520px; }

  /* Glifos decorativos más discretos */
  .hero::before { font-size: 64px; top: 4%; }
  .hero::after { font-size: 72px; top: auto; bottom: 6%; }
  .hero .decor2::before, .hero .decor3::before { content: none; }
  .hero .decor1::before { font-size: 60px; bottom: auto; top: 40%; left: 4%; }
}

/* Grids intermedios */
@media (min-width: 700px) and (max-width: 1023px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .footer__top { grid-template-columns: 1fr; gap: 1.75rem; }
}

@media (min-width: 1024px) {
  .services__grid { grid-template-columns: repeat(3, 1fr); }
  .portfolio__grid { grid-template-columns: repeat(3, 1fr); }

  /* Timeline alternada a dos columnas */
  .process__timeline::after { left: 50%; transform: translateX(-50%); }
  .process__item { width: 50%; }
  .process__item:nth-child(odd) {
    padding: .7rem 66px .7rem 0;
    text-align: right;
    margin-left: auto;
  }
  .process__item:nth-child(odd)::before { right: auto; left: -22px; }
  .process__item:nth-child(even) { padding: .7rem 0 .7rem 66px; margin-right: auto; text-align: left; }
  .process__item:nth-child(even)::before { left: auto; right: -22px; }
}

@media (max-width: 480px) {
  .nav__controls { gap: .4rem; }
  .nav__lang-select { height: 36px; }
  .nav__logo svg { height: 30px; }
  .hero__cta { width: 100%; }
  .hero__cta .button { flex: 1 1 auto; text-align: center; }
  .section__title { margin-bottom: 2.3rem; }
  .modal { padding: .75rem; }
  .footer__bottom { justify-content: center; text-align: center; }
}

/* 19) REDUCED MOTION ------------------------------------------------------------ */
/* Con movimiento reducido todo debe verse bien en su estado final estático. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  /* Cursor del typewriter: bloque fijo visible */
  .cursor { animation: none; }

  /* El barrido de luz no puede recorrer la tarjeta: en su lugar,
     barra de luz ESTÁTICA con el trio de marca al hacer hover. */
  .service-card:hover::before {
    left: 0;
    background: linear-gradient(90deg, var(--blue), var(--cyan), var(--pink));
  }

  /* Sin zoom “teletransportado” en imágenes de portafolio */
  .portfolio-card:hover .portfolio-card__image { transform: none; }

  /* Glifos del hero quietos en su rotación base */
  .hero::before, .hero::after,
  .hero .decor1::before, .hero .decor2::before, .hero .decor3::before {
    animation: none;
    transform: rotate(var(--r, 0deg));
  }
}
