/* ==================================================
   Cyber Glitch — estilos propios de la plantilla (hero: Breach Protocol)
   Barra, botones, secciones comunes, similares, CTA y WhatsApp vienen de themes/_kit/am-kit.css
   ================================================== */

.cg-hero {
	--cy: #f8f62c;      /* amarillo cyberpunk del original */
	--cyan: #00f0ff;
	--mag: #ff2a6d;
	--code: #d0ed57;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100svh;
	min-height: 700px;
	padding-top: 68px;
	overflow: hidden;
	color: #f5f5f0;
	background: #07060d;
}

/* ---------- Imágenes, datamosh y textura ---------- */
.cg-stage { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.cg-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0; }
.cg-img.is-on { opacity: 1; }
.cg-melt { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; image-rendering: pixelated; opacity: 0; pointer-events: none; }
.cg-fx {
	position: absolute;
	inset: 0;
	z-index: 2;
	background:
		repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
		linear-gradient(90deg, rgba(7, 6, 13, .88) 0%, rgba(7, 6, 13, .55) 38%, rgba(7, 6, 13, .1) 62%, rgba(7, 6, 13, .45) 100%),
		radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .65) 100%);
	pointer-events: none;
}

/* ---------- HUD ---------- */
/* Marco del HUD: esquinas del área de contenido (entre la barra y el pie) */
.cg-corners { position: absolute; z-index: 0; inset: 16px; pointer-events: none; }
.cg-corners i { position: absolute; width: 34px; height: 34px; border: 2px solid var(--cy); }
.cg-corners i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.cg-corners i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.cg-corners i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.cg-corners i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.cg-hud { position: absolute; z-index: 3; top: 92px; left: calc(var(--gutter) + 22px); font-family: var(--mb-mono); font-size: 11px; line-height: 1.6; letter-spacing: .12em; text-transform: uppercase; color: rgba(245, 245, 240, .75); pointer-events: none; }
.cg-hud p { margin: 0; }
.cg-hud b { color: var(--cy); font-weight: 700; }
.cg-hud__node { margin-left: 6px; padding: 0 6px; color: #07060d; background: var(--cy); }
.cg-reticle { position: absolute; z-index: 3; left: 0; top: 0; width: 84px; height: 84px; margin: -42px 0 0 -42px; opacity: 0; pointer-events: none; }
.cg-hero.has-cursor .cg-reticle { opacity: 1; }
.cg-reticle__ring { position: absolute; inset: 0; border: 1px dashed rgba(0, 240, 255, .8); border-radius: 50%; animation: cg-spin 6s linear infinite; }
.cg-reticle__cross { position: absolute; inset: 30px; border: 2px solid var(--cy); }
.cg-reticle__cross::before, .cg-reticle__cross::after { content: ''; position: absolute; background: var(--cy); }
.cg-reticle__cross::before { left: 50%; top: -18px; bottom: -18px; width: 1px; }
.cg-reticle__cross::after { top: 50%; left: -18px; right: -18px; height: 1px; }
.cg-reticle__lab { position: absolute; left: 92px; top: 30px; font-family: var(--mb-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; color: var(--cyan); }
@keyframes cg-spin { to { transform: rotate(360deg); } }

/* ---------- Contenido: texto a la izquierda, intrusión a la derecha ---------- */
.cg-main {
	position: relative;
	z-index: 4;
	flex: 1 1 auto;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: clamp(20px, 4vw, 60px);
	align-items: center;
	padding: clamp(60px, 9vh, 96px) calc(var(--gutter) + 22px) clamp(20px, 4vh, 40px);
}
.cg-copy { max-width: 660px; }
.cg-label { margin: 0 0 6px 4px; font-family: 'Rajdhani', var(--mb-mono); font-size: 20px; font-style: italic; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.cg-label strong { font-weight: 700; color: var(--cy); }
.cg-page .cg-title {
	margin: 0 0 22px;
	padding-right: 20px;
	font-family: 'Orbitron', var(--mb-display);
	font-size: clamp(44px, 7vw, 112px);
	font-style: italic;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -.03em;
	text-align: left;
	text-transform: none;
	color: var(--cy);
	text-shadow: 0 5px 0 rgba(0, 0, 0, .5), 0 0 40px rgba(248, 246, 44, .25);
}
.cg-title .cg-wd { display: inline-block; white-space: nowrap; }
.cg-title .cg-ch { display: inline-block; }
.cg-page .cg-title.is-long { font-size: clamp(38px, 5.2vw, 84px); }
/* Caja inclinada con el texto que se escribe solo (como el original) */
.cg-box { position: relative; max-width: 600px; margin: 0 0 26px 18px; padding: 22px 30px; }
.cg-box::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .25); transform: skewX(-10deg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cg-text { min-height: 3.1em; margin: 0; font-family: 'Rajdhani', sans-serif; font-size: clamp(17px, 1.45vw, 21px); font-weight: 500; line-height: 1.45; letter-spacing: .02em; color: #fff; }
.cg-text.is-typing::after { content: ''; display: inline-block; width: .5em; height: 1em; margin-left: 3px; vertical-align: -2px; background: var(--cy); animation: cg-blink .5s steps(1) infinite; }
@keyframes cg-blink { 50% { opacity: 0; } }
.ak-page .cg-next {
	display: inline-flex;
	align-items: center;
	width: auto;
	min-height: 60px;
	margin: 0 0 0 calc(18px + 40%);
	padding: 0 46px;
	font-family: 'Rajdhani', sans-serif;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #000;
	background: var(--cy);
	border: 0;
	border-radius: 0;
	clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
	cursor: pointer;
	transition: background-color .1s linear, transform .1s linear;
}
.ak-page .cg-next:hover, .ak-page .cg-next:focus-visible { color: #000; background: #fff; transform: scale(1.05); }

/* ---------- Protocolo de intrusión ---------- */
.cg-breach {
	position: relative;
	width: 392px;
	padding: 0 0 14px;
	font-family: 'Rajdhani', sans-serif;
	background: rgba(8, 7, 16, .78);
	border: 1px solid rgba(248, 246, 44, .55);
	box-shadow: 0 0 0 4px rgba(248, 246, 44, .06), 0 20px 50px -10px rgba(0, 0, 0, .8);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.cg-breach__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--cy); }
.cg-breach__head p { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #07060d; }
.cg-breach__timer { position: relative; flex: 0 0 110px; height: 8px; background: rgba(7, 6, 13, .25); }
.cg-breach__timer i { position: absolute; inset: 0; background: #07060d; transform-origin: 0 50%; }
.cg-breach__body { display: flex; gap: 16px; padding: 14px 16px 6px; }
.cg-matrix { display: grid; grid-template-columns: repeat(5, 40px); gap: 4px; }
.ak-page .cg-cell {
	display: grid;
	place-items: center;
	width: 40px;
	height: 36px;
	min-height: 0;
	margin: 0;
	padding: 0;
	font-family: 'Rajdhani', sans-serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--code);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 0;
	cursor: default;
	transition: background-color .12s linear, color .12s linear, border-color .12s linear;
}
.ak-page .cg-cell:disabled { opacity: .55; }
.ak-page .cg-cell.is-avail { opacity: 1; background: rgba(248, 246, 44, .1); cursor: pointer; }
.ak-page .cg-cell.is-avail:hover, .ak-page .cg-cell.is-avail:focus-visible, .ak-page .cg-cell.is-ai { color: #07060d; background: var(--cy); border-color: var(--cy); }
.ak-page .cg-cell.is-used { color: rgba(208, 237, 87, .25); opacity: 1; }
.cg-breach__side { flex: 1 1 auto; min-width: 0; }
.cg-breach__lab { margin: 0 0 6px; font-family: var(--mb-mono); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(245, 245, 240, .6); }
.cg-seq, .cg-buffer { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.cg-seq span, .cg-buffer span { display: grid; place-items: center; width: 36px; height: 30px; font-size: 16px; font-weight: 700; }
.cg-seq span { color: var(--code); border: 1px solid rgba(208, 237, 87, .35); }
.cg-seq span.is-done { color: #07060d; background: var(--code); }
.cg-buffer span { color: var(--cyan); border: 1px dashed rgba(0, 240, 255, .45); }
.cg-breach__msg { min-height: 1.4em; margin: 0 16px; font-family: var(--mb-mono); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.cg-breach__hint { margin: 4px 16px 0; font-size: 14px; line-height: 1.35; color: rgba(245, 245, 240, .65); }
.cg-breach.is-ok { border-color: var(--code); box-shadow: 0 0 0 4px rgba(208, 237, 87, .25), 0 0 60px rgba(208, 237, 87, .35); }
.cg-breach.is-ok .cg-breach__msg { color: var(--code); }
.cg-breach.is-fail { border-color: var(--mag); }
.cg-breach.is-fail .cg-breach__head { background: var(--mag); }
.cg-breach.is-fail .cg-breach__msg { color: var(--mag); }

/* ---------- Pie del hero ---------- */
.cg-foot {
	position: relative;
	z-index: 6;
	flex: 0 0 auto;
	display: grid;
	grid-template-columns: minmax(260px, 1fr) auto auto;
	gap: 14px clamp(20px, 3vw, 44px);
	align-items: center;
	/* a la derecha queda libre el lugar del botón flotante de WhatsApp */
	padding: 14px calc(var(--gutter) + 140px) 16px var(--gutter);
	background: rgba(7, 6, 13, .9);
	border-top: 3px solid var(--accent);
}
.cg-foot__meta { margin: 0 0 4px; font-family: var(--mb-mono); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.cg-foot__lead { max-width: 60ch; margin: 0; font-size: clamp(14px, 1.1vw, 17px); line-height: 1.5; color: rgba(245, 245, 240, .86); }
.cg-ctrl { display: flex; align-items: center; gap: 10px; }
.cg-count { margin: 0 6px 0 0; font-family: var(--mb-mono); font-size: 14px; color: rgba(245, 245, 240, .7); white-space: nowrap; }
.cg-idx { display: inline-block; font-family: var(--mb-display); font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -.02em; vertical-align: -5px; color: var(--accent); }
@media (max-width: 1180px) {
	.cg-foot { grid-template-columns: minmax(0, 1fr) auto; }
	.cg-foot .ak-actions { grid-column: 1 / -1; }
	.cg-breach { width: 360px; }
	.cg-breach__hint { display: none; }
}
/* Pantallas bajas */
@media (max-height: 820px) and (min-width: 1001px) {
	.cg-main { padding-top: 64px; }
	.cg-page .cg-title { margin-bottom: 14px; font-size: clamp(40px, 5.6vw, 88px); }
	.cg-box { margin-bottom: 18px; padding: 16px 26px; }
	.ak-page .cg-next { min-height: 52px; }
	.cg-breach__hint { display: none; }
}

/* ---------- Tablet y móvil: todo en columna ---------- */
@media (max-width: 1000px) {
	.cg-hero { height: auto; min-height: 100svh; }
	.cg-main { grid-template-columns: 1fr; align-content: center; padding-top: 96px; }
	.cg-breach { justify-self: start; }
	.ak-page .cg-next { margin-left: 18px; }
	.cg-fx { background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, rgba(0, 0, 0, 0) 1px 3px), linear-gradient(rgba(7, 6, 13, .55), rgba(7, 6, 13, .8)); }
}
@media (max-width: 700px) {
	.cg-hero { padding-top: 60px; }
	.cg-main { padding: 84px var(--gutter) 24px; }
	.cg-hud { top: 74px; left: var(--gutter); font-size: 10px; }
	.cg-corners { inset: 8px; }
	.cg-corners i { width: 22px; height: 22px; }
	.cg-label { font-size: 16px; }
	.cg-box { margin-left: 10px; padding: 16px 20px; }
	.cg-breach { width: 100%; max-width: 392px; }
	.cg-breach__body { gap: 12px; padding: 12px; }
	.cg-matrix { grid-template-columns: repeat(5, 36px); }
	.ak-page .cg-cell { width: 36px; height: 34px; font-size: 16px; }
	.cg-seq span, .cg-buffer span { width: 32px; height: 28px; font-size: 14px; }
	.cg-foot { grid-template-columns: 1fr; padding: 14px var(--gutter) 88px; }
	.cg-ctrl { order: -1; }
	.cg-foot .ak-actions .ak-btn { flex: 1 1 auto; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	.cg-reticle { display: none; }
	.cg-text.is-typing::after { animation: none; }
}
