/* ==========================================================================
   Tecnovad AI — estilo futurista (solo se carga en /productos/tecnovad-ai/)
   Paleta inspirada en el vídeo del producto: azul profundo, cian luminoso y acento dorado.
   ========================================================================== */

/* .ai-scope permite usar los componentes de IA en otras páginas (p. ej. el panel de la portada) */
.theme-dark, .ai-scope {
	--ai-bg: #040B1D;
	--ai-bg-2: #071634;
	--ai-cyan: #38BDF8;
	--ai-cyan-2: #22D3EE;
	--ai-violet: #6366F1;
	--ai-gold: #D9B86C;
	--ai-text: #E6F1FF;
	--ai-muted: #9DB2D3;
	--ai-line: rgba(125, 211, 252, .16);
	--ai-glass: rgba(15, 32, 70, .45);
}

.theme-dark {
	/* Variables del sitio redefinidas para el tema oscuro */
	--ink: var(--ai-text);
	--muted: var(--ai-muted);
	--line: var(--ai-line);
	--bg: var(--ai-bg);
	--bg-soft: rgba(255, 255, 255, .03);
	--navy: var(--ai-text);
	--accent: #0EA5E9;
	--accent-hover: #0284C7;
	--sky-100: rgba(56, 189, 248, .12);

	background: var(--ai-bg);
	color: var(--ai-text);
}

/* ---------- Cabecera y menú ---------- */
.theme-dark .site-header::before { background: rgba(4, 11, 29, .72); }
.theme-dark.nav-open .site-header::before { background: var(--ai-bg); }
.theme-dark .site-header.is-scrolled { border-color: var(--ai-line); box-shadow: 0 10px 30px -20px rgba(56, 189, 248, .5); }
.theme-dark .nav-link { color: var(--ai-text); }
.theme-dark .nav-link:hover, .theme-dark .nav-link[aria-expanded="true"] { background: rgba(255, 255, 255, .06); color: #fff; }
.theme-dark .nav-toggle { background: transparent; color: #fff; border-color: var(--ai-line); }
.theme-dark .submenu { background: rgba(7, 22, 52, .96); border-color: var(--ai-line); backdrop-filter: blur(16px); }
.theme-dark .submenu-list a { color: var(--ai-text); }
.theme-dark .submenu-list a:hover, .theme-dark .submenu-list a[aria-current="page"] { background: rgba(56, 189, 248, .08); }
.theme-dark .submenu-icon { background: rgba(56, 189, 248, .12); color: var(--ai-cyan); }
.theme-dark .lang-switch { background: rgba(255, 255, 255, .04); }
.theme-dark .lang-switch a[aria-current="true"] { background: rgba(56, 189, 248, .18); color: #fff; box-shadow: none; }
@media (max-width: 1023px) { .theme-dark .site-nav { background: var(--ai-bg); } }

/* ---------- Utilidades ---------- */
.ai-gradient {
	background: linear-gradient(90deg, var(--ai-cyan-2), var(--ai-cyan) 35%, #A5B4FC 65%, var(--ai-cyan-2));
	background-size: 200% auto;
	-webkit-background-clip: text; background-clip: text; color: transparent;
	animation: ai-shine 6s linear infinite;
	filter: drop-shadow(0 0 18px rgba(56, 189, 248, .35));
}
@keyframes ai-shine { to { background-position: 200% center; } }
.ai-eyebrow {
	margin: 0 0 1rem; font-size: .78rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase;
	color: var(--ai-gold);
}
.ai-lead { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: var(--ai-muted); line-height: 1.7; }
.btn-ai {
	color: #021025; font-weight: 700;
	background: linear-gradient(90deg, var(--ai-cyan-2), var(--ai-cyan));
	box-shadow: 0 0 0 1px rgba(56, 189, 248, .4), 0 10px 40px -8px rgba(34, 211, 238, .75);
}
.btn-ai:hover { color: #021025; box-shadow: 0 0 0 1px rgba(56, 189, 248, .6), 0 12px 50px -6px rgba(34, 211, 238, .95); transform: translateY(-1px); }
.btn-ai .icon { transition: transform .2s var(--ease); }
.btn-ai:hover .icon { transform: translateX(3px); }

/* ---------- Hero ---------- */
.ai-hero {
	position: relative; isolation: isolate; overflow: hidden;
	padding-block: clamp(4rem, 9vw, 7.5rem) clamp(4rem, 8vw, 6.5rem);
	background:
		radial-gradient(70% 60% at 75% 40%, rgba(37, 99, 235, .28), transparent 70%),
		linear-gradient(180deg, var(--ai-bg) 0%, var(--ai-bg-2) 100%);
}
/* Retícula tecnológica */
.ai-hero::before {
	content: ""; position: absolute; inset: 0; z-index: -2;
	background-image:
		linear-gradient(rgba(125, 211, 252, .07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(125, 211, 252, .07) 1px, transparent 1px);
	background-size: 56px 56px;
	mask-image: radial-gradient(80% 70% at 60% 40%, #000 30%, transparent 85%);
	-webkit-mask-image: radial-gradient(80% 70% at 60% 40%, #000 30%, transparent 85%);
	animation: ai-grid 30s linear infinite;
}
@keyframes ai-grid { to { background-position: 56px 56px, 56px 56px; } }
.ai-net { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: .8; }
/* Fundido inferior: la cabecera se disuelve en el fondo negro de la sección siguiente */
.ai-hero::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: 240px; pointer-events: none;
	background: linear-gradient(180deg, rgba(4, 11, 29, 0) 0%, rgba(4, 11, 29, .55) 45%, rgba(4, 11, 29, .9) 75%, var(--ai-bg) 100%);
}
.ai-glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(80px); opacity: .5; pointer-events: none; }
.ai-glow-1 { width: 420px; height: 420px; right: 8%; top: 10%; background: #1D4ED8; animation: ai-float 12s ease-in-out infinite; }
.ai-glow-2 { display: none; }   /* halo inferior izquierdo retirado: se veía detrás de los botones */
@keyframes ai-float { 50% { transform: translate(30px, -24px) scale(1.08); } }

.ai-hero-grid { display: grid; gap: clamp(2.5rem, 6vw, 4rem); align-items: center; }
@media (min-width: 1024px) { .ai-hero-grid { grid-template-columns: 1fr 1.1fr; } }

.ai-kicker {
	display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.5rem;
	padding: .45rem 1rem .45rem .75rem; border-radius: 999px;
	border: 1px solid rgba(56, 189, 248, .35); background: rgba(56, 189, 248, .08);
	font-size: .85rem; font-weight: 500; color: #CFEFFF; backdrop-filter: blur(8px);
}
.ai-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ai-cyan-2); box-shadow: 0 0 12px var(--ai-cyan-2); }
.ai-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--ai-cyan-2); animation: ai-ping 2s ease-out infinite; }
@keyframes ai-ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }

.ai-hero h1 { margin-bottom: 1.5rem; }
.ai-title { display: block; font-size: clamp(3rem, 8vw, 6rem); font-weight: 750; letter-spacing: -.04em; line-height: .95; color: #fff; }
.ai-title-sub { display: block; margin-top: 1rem; font-size: clamp(1.35rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -.01em; color: #CFE3FF; }
.ai-hero .ai-lead { max-width: 36.75em; margin-bottom: 2rem; }
.ai-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }
.ai-chips li {
	display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px;
	border: 1px solid var(--ai-line); background: rgba(255, 255, 255, .03); color: var(--ai-muted); font-size: .9rem;
}
.ai-chips .icon { color: var(--ai-cyan); }

.ai-hero-visual { position: relative; }
.ai-frame {
	position: relative; overflow: hidden; border-radius: 22px;
	border: 1px solid rgba(56, 189, 248, .35);
	box-shadow: 0 0 0 6px rgba(56, 189, 248, .05), 0 30px 80px -20px rgba(37, 99, 235, .7), 0 0 60px -10px rgba(34, 211, 238, .45);
	transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
	transition: transform .6s var(--ease);
}
.ai-hero-visual:hover .ai-frame { transform: perspective(1400px) rotateY(0) rotateX(0); }
.ai-frame img { width: 100%; }
.ai-scan {
	position: absolute; left: 0; right: 0; top: -30%; height: 30%; pointer-events: none;
	background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .18), transparent);
	animation: ai-scan 5s ease-in-out infinite;
}
@keyframes ai-scan { to { top: 100%; } }
.ai-orbit { position: absolute; z-index: -1; border-radius: 50%; border: 1px dashed rgba(56, 189, 248, .25); pointer-events: none; }
.ai-orbit-1 { inset: -14% -8%; animation: spin 60s linear infinite; }
.ai-orbit-2 { inset: -26% -18%; border-style: solid; border-color: rgba(99, 102, 241, .12); animation: spin 90s linear infinite reverse; }

/* ---------- Secciones ---------- */
.ai-section { position: relative; padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.ai-section .ai-lead:last-child { margin-bottom: 0; }
.ai-head { text-align: center; max-width: 760px; margin: 0 auto 2.5rem; }
.ai-head p:last-child { margin-bottom: 0; }
.ai-head h2, .ai-section h2 { color: #fff; }
.ai-head p:not(.ai-eyebrow) { color: var(--ai-muted); font-size: 1.15rem; }
.ai-statement { text-align: center; padding-top: clamp(3.5rem, 7vw, 5.5rem); background: radial-gradient(55% 60% at 50% 55%, rgba(37, 99, 235, .1), transparent 70%); }
.ai-statement h2 { font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1.15; }

/* Hub de integración (algo menos de aire por debajo: el propio hub ya deja margen) */
.ai-hub-section { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.ai-hub { position: relative; width: min(680px, 100%); aspect-ratio: 1; margin-inline: auto; }
.ai-hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ai-hub-lines line {
	stroke: rgba(56, 189, 248, .55); stroke-width: 1.25; stroke-dasharray: 4 7;
	animation: ai-flow 2.4s linear infinite; animation-delay: var(--d);
	vector-effect: non-scaling-stroke;
}
@keyframes ai-flow { to { stroke-dashoffset: -22; } }
.ai-ring { position: absolute; border-radius: 50%; pointer-events: none; }
.ai-ring-1 { inset: 10%; border: 1px solid rgba(56, 189, 248, .14); }
.ai-ring-2 { inset: 28%; border: 1px dashed rgba(56, 189, 248, .22); animation: spin 40s linear infinite; }
.ai-core {
	position: absolute; left: 50%; top: 50%; translate: -50% -50%;
	display: grid; place-items: center; gap: .35rem; width: 30%; aspect-ratio: 1; border-radius: 50%;
	background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, .35), rgba(7, 22, 52, .95) 70%);
	border: 1px solid rgba(56, 189, 248, .6);
	box-shadow: 0 0 40px rgba(34, 211, 238, .45), inset 0 0 30px rgba(56, 189, 248, .35);
	text-align: center; animation: ai-breathe 4s ease-in-out infinite;
}
.ai-core .icon { width: 2.6rem; height: 2.6rem; color: var(--ai-cyan-2); filter: drop-shadow(0 0 10px rgba(34, 211, 238, .9)); align-self: end; }
.ai-core strong { align-self: start; font-size: .95rem; letter-spacing: .04em; color: #fff; }
@keyframes ai-breathe { 50% { box-shadow: 0 0 70px rgba(34, 211, 238, .65), inset 0 0 40px rgba(56, 189, 248, .5); } }
.ai-nodes li {
	position: absolute; left: var(--x); top: var(--y); translate: -50% -50%;
	display: flex; flex-direction: column; align-items: center; gap: .4rem; width: 128px;
	padding: .85rem .6rem; border-radius: 16px; text-align: center; font-size: .88rem; font-weight: 500; line-height: 1.25;
	background: var(--ai-glass); border: 1px solid var(--ai-line); backdrop-filter: blur(10px);
	box-shadow: 0 10px 30px -15px rgba(0, 0, 0, .8);
	transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.ai-nodes li:hover { border-color: rgba(56, 189, 248, .6); box-shadow: 0 0 30px -6px rgba(56, 189, 248, .6); transform: translateY(-3px); }
.ai-nodes .icon { width: 1.5rem; height: 1.5rem; color: var(--ai-cyan); }
@media (max-width: 719px) {
	.ai-hub { aspect-ratio: auto; display: grid; gap: 1.25rem; }
	.ai-hub-lines, .ai-ring { display: none; }
	.ai-core { position: relative; left: auto; top: auto; translate: none; width: 150px; margin: 0 auto; }
	.ai-nodes { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
	.ai-nodes li { position: static; translate: none; width: auto; }
}

/* Tarjetas de capacidades */
.ai-cards { display: grid; gap: 1.25rem; }
@media (min-width: 680px) { .ai-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ai-cards { grid-template-columns: repeat(3, 1fr); } }
.ai-card {
	position: relative; overflow: hidden; padding: 2rem; border-radius: 22px;
	background: linear-gradient(160deg, rgba(20, 44, 96, .55), rgba(7, 18, 44, .55));
	border: 1px solid var(--ai-line);
	transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.ai-card::before {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
	background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(56, 189, 248, .14), transparent 45%);
}
.ai-card:hover { transform: translateY(-4px); border-color: rgba(56, 189, 248, .45); box-shadow: 0 20px 50px -25px rgba(34, 211, 238, .6); }
.ai-card:hover::before { opacity: 1; }
.ai-card h3 { margin: 1.25rem 0 .5rem; color: #fff; }
.ai-card p { margin: 0; color: var(--ai-muted); }
.ai-card-icon {
	display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 1.3rem;
	color: var(--ai-cyan-2); background: rgba(34, 211, 238, .08); border: 1px solid rgba(34, 211, 238, .3);
	box-shadow: 0 0 24px -6px rgba(34, 211, 238, .6);
}

/* Vídeo */
.ai-video {
	position: relative; max-width: 1080px; margin-inline: auto; padding: 6px; border-radius: 24px;
	background: linear-gradient(135deg, rgba(34, 211, 238, .7), rgba(99, 102, 241, .5), rgba(34, 211, 238, .2));
	box-shadow: 0 30px 70px -40px rgba(37, 99, 235, .45);
}
.ai-video video { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 19px; background: #000; }

/* Pasos */
.ai-steps { display: grid; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 860px) { .ai-steps { grid-template-columns: repeat(3, 1fr); } }
.ai-steps li {
	position: relative; padding: 2rem; border-radius: 22px; border: 1px solid var(--ai-line);
	background: rgba(255, 255, 255, .02);
}
.ai-steps h3 { margin: 1rem 0 .5rem; color: #fff; font-size: 1.4rem; }
.ai-steps p { margin: 0; color: var(--ai-muted); }
.ai-step-n {
	font-size: 2.6rem; font-weight: 750; line-height: 1;
	background: linear-gradient(180deg, var(--ai-cyan-2), rgba(56, 189, 248, .15));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (min-width: 860px) {
	.ai-steps li:not(:last-child)::after {
		content: ""; position: absolute; top: 3rem; right: -1.25rem; width: 1.25rem; height: 1px;
		background: linear-gradient(90deg, var(--ai-cyan), transparent);
	}
}

/* Frase final */
.ai-future {
	text-align: center; overflow: hidden;
	background: radial-gradient(50% 90% at 50% 100%, rgba(34, 211, 238, .2), transparent 70%), var(--ai-bg-2);
}
.ai-future h2 { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.03em; }
.ai-future .ai-lead { margin-bottom: 2rem; }

/* ---------- Componentes comunes en modo oscuro ---------- */
.theme-dark .values { background: var(--ai-bg); }
.theme-dark .value-card { background: rgba(255, 255, 255, .03); border-color: var(--ai-line); }
.theme-dark .value-card h3 { color: #fff; }
.theme-dark .value-icon { background: linear-gradient(135deg, #1D4ED8, var(--ai-cyan)); }
.theme-dark .contact { background: radial-gradient(60% 70% at 0% 0%, rgba(34, 211, 238, .18), transparent 60%), linear-gradient(160deg, var(--ai-bg-2), var(--ai-bg)); border-top: 1px solid var(--ai-line); }
.theme-dark .contact-form { background: rgba(10, 26, 60, .7); border: 1px solid var(--ai-line); backdrop-filter: blur(14px); }
.theme-dark .field label { color: #DCEBFF; }
.theme-dark .field label span { color: var(--ai-cyan); }
.theme-dark .input { background: rgba(255, 255, 255, .04); border-color: rgba(125, 211, 252, .2); color: #fff; }
.theme-dark .input::placeholder { color: #6F86AA; }
.theme-dark .input:focus { background: rgba(255, 255, 255, .07); border-color: var(--ai-cyan); }
.theme-dark .contact-form .btn-primary { background: linear-gradient(90deg, var(--ai-cyan-2), var(--ai-cyan)); color: #021025; }
.theme-dark .site-footer { background: #030817; border-color: var(--ai-line); }
.theme-dark .footer-col a, .theme-dark .footer-col .link-button { color: var(--ai-text); }
.theme-dark .footer-cta a { color: var(--ai-cyan); }
.theme-dark .dialog { background: var(--ai-bg-2); color: var(--ai-text); border: 1px solid var(--ai-line); }
.theme-dark .dialog-close { background: rgba(255, 255, 255, .06); color: var(--ai-muted); }

/* ---------- Panel de Tecnovad AI en la portada ---------- */
.ai-spotlight { padding-block: var(--section); }
.ai-panel {
	position: relative; isolation: isolate; overflow: hidden;
	padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
	border-radius: 32px; color: var(--ai-text);
	background:
		radial-gradient(70% 70% at 80% 30%, rgba(37, 99, 235, .35), transparent 70%),
		radial-gradient(50% 60% at 0% 100%, rgba(34, 211, 238, .16), transparent 70%),
		linear-gradient(160deg, var(--ai-bg-2) 0%, var(--ai-bg) 100%);
	box-shadow: 0 40px 90px -40px rgba(4, 11, 29, .9), 0 0 0 1px rgba(56, 189, 248, .15);
}
.ai-panel::before {
	content: ""; position: absolute; inset: 0; z-index: -2;
	background-image:
		linear-gradient(rgba(125, 211, 252, .07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(125, 211, 252, .07) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 90%);
	-webkit-mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 90%);
	animation: ai-grid 30s linear infinite;
}
.ai-panel .ai-hero-grid { position: relative; }
.ai-panel h2 { margin-bottom: 1.25rem; }
.ai-panel .ai-title { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.ai-panel .ai-title-sub { font-size: clamp(1.2rem, 2.2vw, 1.7rem); }
.ai-panel .ai-lead { margin-bottom: 2rem; }
.ai-panel .ai-lead strong { color: #fff; }
/* Descripción corta solo en móvil */
.ai-panel .ai-lead-short { display: none; }
@media (max-width: 599px) {
	.ai-panel .ai-lead-short { display: block; }
	.ai-panel .ai-lead-full { display: none; }
}
.ai-panel .ai-frame { display: block; transform: perspective(1400px) rotateY(-5deg) rotateX(2deg); }
.ai-panel .btn-ghost { color: #fff; }

.ai-hero-grid > *, .ai-cards > *, .ai-steps > * { min-width: 0; }
@media (max-width: 599px) {
	.ai-title { font-size: clamp(2.8rem, 15vw, 4rem); }
	.ai-panel { padding: 2rem 1.25rem; border-radius: 24px; }
	.ai-panel .ai-title { font-size: clamp(2.6rem, 14vw, 3.6rem); }
	.ai-kicker { font-size: .85rem; padding: .4rem .8rem .4rem .6rem; }
	.ai-frame, .ai-panel .ai-frame { transform: none; }
	.ai-card, .ai-steps li { padding: 1.5rem; }
	.ai-lead, .ai-head p:not(.ai-eyebrow) { font-size: 1.15rem; }
	.ai-eyebrow { font-size: .85rem; letter-spacing: .2em; }
	.ai-nodes li { font-size: .95rem; }
	/* Menos texto: las etiquetas repiten lo que ya dice el párrafo */
	.ai-chips, .ai-panel .ai-kicker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ai-frame, .ai-panel .ai-frame { transform: none; }
	.ai-scan, .ai-glow { display: none; }
}
