/* Lophex Digital — landing
   Colores y tipografías según el Manual de Identidad Gráfica:
   Teal #008898 · Cian #00CAED · Blanco · Negro / azul oscuro
   Títulos: Rethink Sans Semibold · Cuerpos: Inter Regular */

:root {
  /* marca (fijos en ambos temas) */
  --teal: #008898;
  --cian: #00CAED;
  --tinta: #071316;
  --abismo: #06343C;
  --blanco: #FFFFFF;

  /* tema claro */
  --bg: #F2F8F9;
  --bg-tint: #E6F1F3;
  --surface: #FFFFFF;
  --text: #0B1B1F;
  --muted: #4A6166;
  --line: #D3E2E5;
  --accent: #008898;
  --accent-ink: #006B77;
  --tag-bg: #E3F2F4;
  --tag-text: #0A5660;

  /* tipografía */
  --f-display: "Rethink Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* escala */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --t-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --t-3xl: clamp(2.6rem, 1.6rem + 4.6vw, 5.25rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --radius: 18px; /* eco de las esquinas del icono */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081316;
    --bg-tint: #0B1B1F;
    --surface: #0F2126;
    --text: #E4F0F2;
    --muted: #93ABB0;
    --line: #1C343A;
    --accent: #00CAED;
    --accent-ink: #4FD8F0;
    --tag-bg: #0F2D33;
    --tag-text: #8FE4F3;
  }
}
:root[data-theme="dark"] {
  --bg: #081316;
  --bg-tint: #0B1B1F;
  --surface: #0F2126;
  --text: #E4F0F2;
  --muted: #93ABB0;
  --line: #1C343A;
  --accent: #00CAED;
  --accent-ink: #4FD8F0;
  --tag-bg: #0F2D33;
  --tag-text: #8FE4F3;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--t-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
:focus-visible { outline: 3px solid var(--cian); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--cian); color: var(--tinta); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 16px; }

/* líneas de velocidad — tomadas del icono */
.vel { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; width: 22px; flex: none; }
.vel i { display: block; height: 3px; border-radius: 1px; background: currentColor; }
.vel i:nth-child(1) { width: 55%; }
.vel i:nth-child(2) { width: 80%; }
.vel i:nth-child(3) { width: 65%; }
.vel i:nth-child(4) { width: 100%; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow--light { color: var(--cian); }

/* botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 var(--t-md)/1 var(--f-display);
  letter-spacing: -0.01em;
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--cian);
  color: var(--tinta);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .2s ease;
}
.btn:hover { background: #3DD9F3; box-shadow: 0 8px 28px -8px rgba(0, 202, 237, .7); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--blanco); border-color: rgba(255,255,255,.28); }
.btn--ghost:hover { background: rgba(255,255,255,.08); box-shadow: none; }
.btn--small { padding: 11px 16px; font-size: var(--t-sm); border-radius: 10px; }
.btn--block { width: 100%; }

/* navegación */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  color: var(--blanco);
}
/* El fondo vive en su propia capa con el desenfoque siempre activo;
   al hacer scroll solo cambia la opacidad (no se agrega ni quita el filtro), así no parpadea. */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(7, 19, 22, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  opacity: 0;
  transform: translateZ(0);
  transition: opacity .25s ease;
}
.nav.is-scrolled::before, .nav.menu-open::before { opacity: 1; }
.nav__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.nav__brand img { height: 30px; width: auto; }
.nav__menu { display: flex; align-items: center; gap: 28px; font-size: var(--t-sm); font-weight: 500; }
.nav__menu a:not(.btn) { text-decoration: none; color: rgba(255,255,255,.78); transition: color .15s; }
.nav__menu a:not(.btn):hover { color: var(--blanco); }
.nav__toggle { display: none; }

@media (max-width: 860px) {
  .nav__toggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 6px;
    width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); cursor: pointer;
  }
  .nav__toggle i { display: block; height: 2px; background: var(--blanco); border-radius: 2px; transition: transform .2s; }
  .nav__toggle i:first-of-type { width: 22px; }
  .nav__toggle i:last-of-type { width: 14px; }
  .nav__toggle[aria-expanded="true"] i:first-of-type { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] i:last-of-type { width: 22px; transform: translateY(-4px) rotate(-45deg); }
  .nav__menu {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 20px;
    background: rgba(7, 19, 22, .97);
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav__menu a:not(.btn) { padding: 12px 0; font-size: var(--t-md); }
  .nav__menu .btn { margin-top: 8px; }
  .nav__menu:not(.is-open) { display: none; }
}

/* hero — el degradado de la tarjeta de presentación */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--blanco);
  background:
    radial-gradient(55% 70% at 88% 100%, rgba(0, 202, 237, .55) 0%, rgba(0, 202, 237, 0) 70%),
    radial-gradient(45% 60% at 62% 35%, rgba(0, 136, 152, .5) 0%, rgba(0, 136, 152, 0) 75%),
    linear-gradient(140deg, #04090B 0%, #071316 30%, #06343C 62%, #0A6773 100%);
  padding-block: 150px 96px;
}
.hero__streaks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(40px, 5vw, 72px); align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.hero h1 { font-size: var(--t-3xl); letter-spacing: -0.035em; line-height: 1.02; max-width: 13ch; }
.hero h1 em { font-style: normal; color: var(--cian); }
.hero__lede { font-size: var(--t-lg); line-height: 1.55; color: rgba(255,255,255,.78); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__place { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .04em; color: rgba(255,255,255,.55); }

/* tarjeta del agente — demostración */
.agent {
  margin: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(4, 14, 17, .62);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: var(--t-sm);
}
.agent__bar { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.agent__bar img { width: 36px; height: 36px; }
.agent__bar div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.agent__bar strong { font-family: var(--f-display); font-weight: 600; }
.agent__bar div span { font-size: var(--t-xs); color: rgba(255,255,255,.55); }
.agent__live {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cian);
}
.agent__live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cian); box-shadow: 0 0 0 0 rgba(0,202,237,.6); animation: pulse 2s infinite; }
.agent__msg { padding: 12px 14px; border-radius: 14px; line-height: 1.5; max-width: 92%; }
.agent__msg--in { background: rgba(255,255,255,.08); border-top-left-radius: 4px; }
.agent__msg--out { background: rgba(0, 136, 152, .5); border: 1px solid rgba(0, 202, 237, .35); align-self: flex-end; border-top-right-radius: 4px; }
.agent__who { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; color: rgba(255,255,255,.5); margin-bottom: 4px; }
.agent__steps { list-style: none; margin: 0; padding: 4px 0 4px 4px; display: flex; flex-direction: column; gap: 8px; }
.agent__steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: var(--t-xs); color: rgba(255,255,255,.78); }
.agent__steps li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3); }
.agent__steps li.done::before { border-color: var(--cian); background: var(--cian) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23071316' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.agent__steps li.now::before { border-color: var(--cian); border-right-color: transparent; animation: spin 1s linear infinite; }
.agent__steps code { font-family: var(--f-mono); font-size: 11px; color: var(--cian); white-space: nowrap; }
.agent figcaption { font-size: 11px; color: rgba(255,255,255,.45); padding-top: 4px; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,202,237,.55); } 70% { box-shadow: 0 0 0 8px rgba(0,202,237,0); } 100% { box-shadow: 0 0 0 0 rgba(0,202,237,0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* secciones */
.section { padding-block: clamp(72px, 9vw, 128px); }
.section--tint { background: var(--bg-tint); }
.section__head { display: flex; flex-direction: column; gap: 18px; max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.section h2 { font-size: var(--t-2xl); }
.section__lede { font-size: var(--t-lg); color: var(--muted); max-width: 36em; }

/* servicios */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 72px); }
.service { display: flex; flex-direction: column; gap: 14px; padding-block: 32px 36px; border-top: 1px solid var(--line); }
.service h3 { font-size: var(--t-xl); display: flex; align-items: baseline; gap: 12px; }
.service p { color: var(--muted); max-width: 32em; }
.service--ia h3 { color: var(--accent-ink); }
.tags { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: var(--t-xs); font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-text); }

/* IA aplicada — banda profunda */
.section--deep {
  color: var(--blanco);
  background:
    radial-gradient(60% 90% at 0% 100%, rgba(0, 202, 237, .18), rgba(0, 202, 237, 0) 70%),
    linear-gradient(180deg, var(--abismo), #052A31);
}
.ia { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.ia__intro { display: flex; flex-direction: column; gap: 20px; }
.ia__intro > p { color: rgba(255,255,255,.75); font-size: var(--t-lg); max-width: 30em; }
.principles { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.principles li { padding-left: 34px; position: relative; color: rgba(255,255,255,.75); }
.principles li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 20px; height: 11px;
  background:
    linear-gradient(var(--cian), var(--cian)) right 0 / 55% 2px no-repeat,
    linear-gradient(var(--cian), var(--cian)) right 4.5px / 80% 2px no-repeat,
    linear-gradient(var(--cian), var(--cian)) right 9px / 100% 2px no-repeat;
}
.principles strong { color: var(--blanco); font-weight: 600; }

.ia__table { border-radius: var(--radius); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); overflow: hidden; }
.ia__row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; padding: 20px 24px; border-top: 1px solid rgba(255,255,255,.08); }
.ia__row:first-child { border-top: 0; }
.ia__row span:first-child { color: rgba(255,255,255,.62); position: relative; }
.ia__row span:last-child { color: var(--blanco); }
.ia__row--head { background: rgba(0,0,0,.18); padding-block: 14px; }
.ia__row--head span { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--cian) !important; }

/* proyectos */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project {
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(24px, 3vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.project__sector { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.project h3 { font-size: var(--t-xl); }
.project p:not(.project__sector) { color: var(--muted); }
.project__stack { list-style: none; margin: auto 0 0; padding: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; border-top: 1px dashed var(--line); }
.project__stack li { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--text); }
.project__stack li + li::before { content: "/"; margin-right: 16px; color: var(--muted); }

.project--cta {
  text-decoration: none;
  color: var(--blanco);
  border-color: transparent;
  background:
    radial-gradient(80% 90% at 100% 100%, rgba(0, 202, 237, .6), rgba(0, 202, 237, 0) 70%),
    linear-gradient(145deg, var(--tinta) 10%, var(--abismo) 55%, var(--teal));
  transition: transform .2s ease, box-shadow .25s ease;
}
.project--cta img { width: 48px; height: 48px; }
.project--cta p:not(.project__sector) { color: rgba(255,255,255,.78); }
.project--cta:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -24px rgba(0, 136, 152, .8); }
.project__go { margin-top: auto; padding-top: 16px; font-family: var(--f-display); font-weight: 600; color: var(--cian); display: inline-flex; gap: 8px; }
.project--cta:hover .project__go span { transform: translateX(4px); }
.project__go span { transition: transform .2s ease; }

/* proceso */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: none; }
.step { display: flex; flex-direction: column; gap: 12px; position: relative; padding-top: 28px; }
.step::before { content: ""; position: absolute; top: 0; left: 0; right: -32px; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 85%); }
.step:last-child::before { right: 0; }
.step__n { font-family: var(--f-mono); font-size: var(--t-sm); font-weight: 500; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.step h3 { font-size: var(--t-lg); letter-spacing: -0.015em; }
.step p { color: var(--muted); font-size: var(--t-sm); }

/* contacto */
.contact {
  color: var(--blanco);
  padding-block: clamp(72px, 9vw, 128px);
  background:
    radial-gradient(50% 80% at 100% 0%, rgba(0, 202, 237, .45), rgba(0, 202, 237, 0) 70%),
    radial-gradient(40% 60% at 20% 100%, rgba(0, 136, 152, .45), rgba(0, 136, 152, 0) 70%),
    linear-gradient(160deg, #04090B, var(--tinta) 40%, var(--abismo));
}
.contact__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.contact__copy { display: flex; flex-direction: column; gap: 20px; }
.contact h2 { font-size: var(--t-2xl); }
.contact__copy > p { color: rgba(255,255,255,.75); font-size: var(--t-lg); max-width: 28em; }
.contact__data { margin: 12px 0 0; display: flex; flex-direction: column; }
.contact__data div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding-block: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.contact__data dt { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--cian); padding-top: 3px; }
.contact__data dd { margin: 0; overflow-wrap: anywhere; }
.contact__data a { text-decoration: none; border-bottom: 1px solid rgba(0,202,237,.5); }
.contact__data a:hover { border-color: var(--cian); }

/* WhatsApp: temas con mensaje precargado + botón general */
.wa {
  display: flex; flex-direction: column; gap: 20px;
  padding: clamp(22px, 3vw, 36px);
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
}
.wa__label { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--cian); }
.wa__topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.wa__topics a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 2px;
  border-top: 1px solid rgba(255,255,255,.1);
  text-decoration: none; color: var(--blanco); font-weight: 500;
  transition: color .15s;
}
.wa__topics li:last-child a { border-bottom: 1px solid rgba(255,255,255,.1); }
.wa__topics a span { flex: none; color: var(--cian); transition: transform .2s ease; }
.wa__topics a:hover { color: var(--cian); }
.wa__topics a:hover span { transform: translate(3px, -3px); }
.wa__note { font-size: var(--t-xs); color: rgba(255,255,255,.5); text-align: center; }
.btn svg { flex: none; }

/* pie */
.footer { background: #04090B; color: rgba(255,255,255,.6); padding-block: 48px; font-size: var(--t-sm); }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.footer img { height: 26px; width: auto; }
.footer__tag { color: rgba(255,255,255,.85); }
.footer__meta { flex-basis: 100%; font-size: var(--t-xs); padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); }
.footer a { text-decoration: none; color: var(--cian); }

/* responsivo */
@media (max-width: 980px) {
  .hero__grid, .ia, .contact__grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: 128px 72px; }
  .agent { max-width: 560px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .step:nth-child(2)::before { right: 0; }
}
@media (max-width: 640px) {
  .services, .projects { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step::before { right: 0; }
  .ia__row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 16px 18px; }
  .ia__row--head { display: none; }
  .contact__data div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .agent__steps li { grid-template-columns: 16px minmax(0, 1fr); }
  .agent__steps code { grid-column: 2; white-space: normal; }
  .hero__actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
