/* ==========================================================================
   ANIMARME — hub (baraja) y páginas de módulo
   Para ajustar el ritmo de la baraja:
     --an-dur   = duración del movimiento de cada carta
     --an-ease  = curva
   (los retardos entre cartas están en assets/js/animarme.js)
   ========================================================================== */

:root {
	--an-dur: 1.35s;
	--an-ease: cubic-bezier(.23, .68, .18, 1);
	--an-gold: #f5c04a;
	--an-gold-soft: #e8b578;
	--an-amber: #f6a93d;
	--an-ink: #0a0806;
	--an-panel: #15100c;
	--f-serif: "Source Serif 4", "Georgia", serif;
	--f-sans: "Fira Sans", "Segoe UI", system-ui, sans-serif;
}

.ico { display: block; width: 1em; height: 1em; }

/* ---------------------------------------------------------------- HUB */

.an {
	min-height: 100vh;
	min-height: 100svh;
	background: #050301;
	color: #f3e2c8;
	font-family: var(--f-sans);
	overflow-x: clip;
}

.an-m,
.an-m__intro { display: none; }

.an__stage {
	position: relative;
	container-type: inline-size;
	width: clamp(1000px, 179.17svh, 100%);
	aspect-ratio: 2752 / 1536;
	margin: 0 auto;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.an { display: grid; place-items: center; }

.an__bgs { position: absolute; inset: 0; }
.an__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	opacity: 0;
	transition: opacity .9s ease;
}
.an__bg.is-on { opacity: 1; }

/* Zonas sensibles sobre la barra dibujada en el fondo */
.hot {
	position: absolute;
	z-index: 5;
	border-radius: .8cqw;
	transition: background-color .3s, box-shadow .3s;
}
.hot:hover,
.hot:focus-visible { background: rgba(255, 190, 80, .09); box-shadow: 0 0 1.4cqw rgba(246, 169, 61, .25); }
.hot--brand  { left: 3.8%;  top: .6%; width: 12.8%; height: 6%; }
.hot--logo   { left: 20%;   top: .4%; width: 13.2%; height: 6.3%; }
.hot--inicio { left: 69.2%; top: .6%; width: 5.2%;  height: 6%; }
.hot--rec    { left: 76.2%; top: .6%; width: 7.9%;  height: 6%; }
.hot--campus { left: 86%;   top: .6%; width: 6.4%;  height: 6%; }
.hot--user   { left: 94.3%; top: .4%; width: 3.3%;  height: 6.4%; border-radius: 50%; }
.hot--baul   { left: 72.2%; top: 76.8%; width: 23.1%; height: 10.6%; border-radius: 1.6cqw; opacity: 0; visibility: hidden; transition: opacity .6s .9s, visibility 0s .9s, background-color .3s, box-shadow .3s; }
.an[data-state]:not([data-state="main"]) .hot--baul { opacity: 1; visibility: visible; }

/* Panel inferior del estado inicial (todavía sin recorrido activo) */
.an__empty { pointer-events: none; transition: opacity .8s ease; }
.an__empty-l,
.an__empty-r {
	position: absolute;
	margin: 0;
	display: flex;
	align-items: center;
	background: #15100c;
	font-size: max(13px, 1.12cqw);
	font-weight: 300;
	color: #cdb994;
	box-shadow: 0 0 1.2cqw 1cqw #15100c;
}
.an__empty-l { left: 12.2%; top: 80%; width: 21%; height: 14%; padding-left: .4cqw; }
.an__empty-r { left: 35.4%; top: 80%; width: 61.6%; height: 14%; }
.an[data-state]:not([data-state="main"]) .an__empty { opacity: 0; }

/* La baraja */
.deck { position: absolute; inset: 0; z-index: 2; }

.dk {
	position: absolute;
	left: 0;
	top: 0;
	width: 14.7cqw;
	aspect-ratio: 246 / 342;
	display: block;
	border-radius: 1.45cqw;
	color: #f6e8d0;
	text-decoration: none;
	background: linear-gradient(180deg, rgba(36, 25, 14, .96), rgba(10, 7, 5, .98));
	box-shadow: 0 1cqw 2.2cqw rgba(0, 0, 0, .7), 0 0 0 1px rgba(246, 169, 61, .35), 0 0 1.3cqw rgba(246, 169, 61, .22);
	transition:
		translate var(--an-dur) var(--an-ease),
		scale var(--an-dur) var(--an-ease),
		opacity calc(var(--an-dur) * .7) ease,
		box-shadow .45s ease,
		filter .45s ease;
	will-change: translate, scale, opacity;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.dk--animarme { width: 16.4cqw; aspect-ratio: 275 / 390; }

.dk__media {
	position: absolute;
	inset: 0 0 auto 0;
	display: block;
	height: 36%;
	overflow: hidden;
	border-radius: inherit;
	-webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
	mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.dk--animarme .dk__media { height: 62%; }
.dk__media img {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: scale .9s var(--an-ease);
}

/* borde luminoso */
.dk::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 1.5px solid rgba(246, 169, 61, .6);
	box-shadow: inset 0 0 1.2cqw rgba(246, 169, 61, .22);
	pointer-events: none;
	transition: border-color .4s, box-shadow .4s;
}

.dk__body {
	position: absolute;
	inset: 33% 6.5% 15% 8%;
	display: flex;
	flex-direction: column;
	gap: .35cqw;
	text-align: left;
}
.dk--animarme .dk__body { inset: 59% 6% 15% 6%; text-align: center; align-items: center; }
.dk--sub .dk__body { inset: 28.5% 6.5% 17% 7.5%; gap: .25cqw; }

.dk__icon { font-size: max(24px, 2.35cqw); color: var(--an-gold); line-height: 1; margin-bottom: .1cqw; }
.dk--sub .dk__icon { font-size: max(21px, 2.05cqw); margin-bottom: .04cqw; }
.dk__title {
	font-family: var(--f-serif);
	font-weight: 600;
	font-size: max(17px, 2.2cqw);
	line-height: 1.05;
	color: #f1cf9c;
	letter-spacing: -.005em;
}
.dk--animarme .dk__title { font-size: max(21px, 2.55cqw); }
.dk--sub .dk__title { font-size: max(15.5px, 1.98cqw); line-height: 1.03; }
.dk__desc {
	font-weight: 300;
	font-size: max(11.5px, 1.03cqw);
	line-height: 1.32;
	color: #f6e8d0;
}
.dk--animarme .dk__desc { font-size: max(12px, 1.1cqw); }
.dk--sub .dk__desc { font-size: max(10.5px, .92cqw); line-height: 1.24; padding-right: 2.6cqw; }

.dk__arrow {
	position: absolute;
	right: 6%;
	bottom: 4.6%;
	display: grid;
	place-items: center;
	width: 2.9cqw;
	height: 2.9cqw;
	min-width: 30px;
	min-height: 30px;
	padding: .55cqw;
	border-radius: 50%;
	border: 1.5px solid rgba(246, 169, 61, .9);
	color: var(--an-amber);
	transition: background-color .35s, color .35s, box-shadow .35s;
}
.dk__arrow .ico { width: 100%; height: 100%; }
.dk--animarme .dk__arrow,
.dk--main .dk__arrow { right: auto; left: 50%; translate: -50% 0; }
.dk--sub .dk__arrow { left: auto; right: 6%; }

/* Encendida (seleccionada / madre) */
.dk.is-lit {
	box-shadow: 0 1.4cqw 2.8cqw rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 190, 90, .9), 0 0 2.2cqw rgba(246, 169, 61, .55);
}
.dk.is-lit::after { border-color: rgba(255, 196, 100, .95); box-shadow: inset 0 0 1.6cqw rgba(246, 169, 61, .4); }

/* Hover / foco */
.dk:hover,
.dk:focus-visible {
	filter: brightness(1.12);
	box-shadow: 0 1.6cqw 3cqw rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 196, 100, .9), 0 0 2.6cqw rgba(246, 169, 61, .6);
}
.dk:hover .dk__media img { scale: 1.06; }
.dk:hover .dk__arrow,
.dk:focus-visible .dk__arrow { background: var(--an-amber); color: #1a1208; box-shadow: 0 0 1.2cqw rgba(246, 169, 61, .7); }
.dk:focus-visible { outline: 2px solid var(--an-amber); outline-offset: 4px; }
.dk[inert] { pointer-events: none; }

/* ---------------------------------------------- Pantallas angostas */
@media (max-width: 999px) {
	.an { display: flex; flex-direction: column; place-items: initial; background: radial-gradient(120% 60% at 50% 0, #1b1209, #060402 70%); }

	.an-m { display: block; order: 1; padding: 1rem 1.1rem 0; text-align: center; }
	.an-m__bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
	.an-m__brand { font-family: var(--f-display); font-size: .7rem; letter-spacing: .18em; color: var(--an-gold); text-decoration: none; }
	.an-m__nav { display: flex; gap: 1rem; font-size: .85rem; }
	.an-m__nav a { color: #e6d3b3; text-decoration: none; }
	.an-m__logo { margin: 1.4rem auto .4rem; border-radius: 50%; }
	.an-m__tag { margin: 0; font-size: .85rem; color: #cdb994; }

	.an-m__intro { display: block; order: 2; padding: 1.6rem 1.1rem .4rem; text-align: center; max-width: 640px; margin-inline: auto; }
	.an-m__intro h2 { margin: 0 0 .6rem; font-family: var(--f-serif); font-weight: 600; font-size: clamp(2rem, 8vw, 2.7rem); color: #f1cf9c; }
	.an-m__intro p { margin: 0; line-height: 1.55; color: #e9dcc4; font-weight: 300; }
	.an-m__baul {
		display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.2rem;
		padding: .8rem 1.4rem; border: 1.5px solid var(--an-amber); border-radius: 999px;
		color: var(--an-gold); font-family: var(--f-serif); font-weight: 600; text-decoration: none;
	}
	.an-m__baul[hidden] { display: none; }
	.an-m__baul .ico { width: 1.1rem; height: 1.1rem; }

	.an__stage { order: 3; container-type: normal; width: 100%; aspect-ratio: auto; mask-image: none; -webkit-mask-image: none; padding: 1.4rem 1.1rem 3rem; }
	.an__bgs, .an__hot, .an__empty, .hot--baul { display: none; }

	.deck { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 720px; margin: 0 auto; }

	.dk {
		position: relative; width: auto; aspect-ratio: auto; min-height: 310px;
		translate: none; scale: none; border-radius: 20px; transition: box-shadow .4s, filter .4s;
	}
	.dk--animarme { width: auto; aspect-ratio: auto; }
	.dk.is-off { display: none; }
	.dk__media { position: relative; inset: auto; height: 165px; }
	.dk--animarme .dk__media { height: 210px; }
	.dk__body,
	.dk--sub .dk__body { position: relative; inset: auto; margin: -1.4rem 1.1rem 0; padding-bottom: 4rem; gap: .35rem; }
	.dk--animarme .dk__body { inset: auto; margin: -1.6rem 1.1rem 0; padding-bottom: 4rem; }
	.dk__icon,
	.dk--sub .dk__icon { font-size: 1.7rem; }
	.dk__title,
	.dk--sub .dk__title { font-size: 1.35rem; }
	.dk__desc,
	.dk--sub .dk__desc { font-size: .92rem; line-height: 1.38; padding-right: 0; }
	.dk__arrow { width: 2.4rem; height: 2.4rem; padding: .5rem; bottom: 1rem; }
	.dk::after { border-radius: 20px; }
}

@media (max-width: 559px) {
	.deck { grid-template-columns: 1fr; max-width: 420px; }
}

/* ---------------------------------------------------------------- MÓDULOS */

.mod {
	min-height: 100vh;
	background:
		radial-gradient(80% 50% at 80% 0, rgba(245, 192, 74, .06), transparent 60%),
		#0a0807;
	color: #f4ead9;
	font-family: var(--f-sans);
	position: relative;
	overflow-x: clip;
}

.mod-top {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
	padding: 1rem clamp(1.2rem, 5.6vw, 5.6rem);
	border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.mod-brand { display: inline-flex; align-items: center; gap: 1rem; text-decoration: none; color: #fff; justify-self: start; }
.mod-brand img { width: 54px; height: 54px; border-radius: 50%; }
.mod-brand span { font-size: clamp(1.1rem, 1.9vw, 1.55rem); font-weight: 300; letter-spacing: .26em; }
.mod-brand em { font-style: normal; color: var(--an-gold-soft); }
.mod-nav { display: flex; gap: clamp(1rem, 2.4vw, 2.4rem); font-size: .95rem; }
.mod-nav a { color: #e9dcc4; text-decoration: none; padding: .3rem 0; transition: color .25s; }
.mod-nav a:hover { color: var(--an-gold); }
.mod-nav a[aria-current] { color: var(--an-gold); }
.mod-me {
	justify-self: end;
	padding: .6rem 1.5rem;
	border: 1.5px solid rgba(245, 192, 74, .7);
	border-radius: 999px;
	color: var(--an-gold);
	text-decoration: none;
	font-size: .92rem;
	transition: background-color .3s, color .3s;
}
.mod-me:hover { background: var(--an-gold); color: #1a1208; }

.mod-label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.4rem;
	margin: 1.2rem 0 0;
	font-size: clamp(.8rem, 1.2vw, 1rem);
	font-weight: 300;
	letter-spacing: .5em;
	text-transform: uppercase;
	color: #efe6d6;
	text-align: center;
}
.mod-label i { flex: 0 1 8rem; height: 2px; background: linear-gradient(90deg, transparent, var(--an-gold), transparent); opacity: .85; }

.mod-wrap { width: min(100% - 2.4rem, 1320px); margin: 0 auto; padding-bottom: 3rem; }

.mod-back {
	display: inline-flex;
	align-items: center;
	gap: .7rem;
	margin: 1.2rem 0 .9rem;
	color: var(--an-gold);
	text-decoration: none;
	font-size: .95rem;
}
.mod-back:hover { text-decoration: underline; }

.mod-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.6rem 2rem; align-items: start; }

.panel {
	border: 1.5px solid rgba(245, 192, 74, .38);
	border-radius: 24px;
	background: linear-gradient(135deg, rgba(34, 24, 15, .85), rgba(14, 10, 8, .92));
	box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}

/* Héroe */
.mod-hero { position: relative; display: flex; align-items: center; min-height: clamp(300px, 31vw, 410px); overflow: hidden; }
.mod-hero__img {
	position: absolute;
	inset: 0 0 0 auto;
	width: 56%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 38%);
	mask-image: linear-gradient(90deg, transparent, #000 38%);
}
.mod-hero__text { position: relative; z-index: 1; width: 64%; padding: clamp(1.6rem, 3.4vw, 3rem); }
.mod-hero__title { margin: 0; font-weight: 300; font-size: clamp(2.1rem, 3.9vw, 3.4rem); line-height: 1.04; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.mod-hero__title i { display: block; font-style: italic; font-weight: 300; }
.mod-hero__title b { display: block; font-weight: 500; color: #f7c95b; }
.mod-hero .rule { display: block; width: 80px; height: 2px; margin: 1.1rem 0; background: linear-gradient(90deg, #f7c95b, transparent); }
.mod-hero__lead { margin: 0; font-size: clamp(.95rem, 1.3vw, 1.15rem); line-height: 1.55; color: #f4ead9; text-shadow: 0 1px 12px rgba(0, 0, 0, .8); max-width: 25em; }

/* Baúl */
.mod-baul { position: relative; display: grid; grid-template-columns: minmax(120px, 34%) 1fr; align-items: center; margin-top: 1.4rem; padding: 1.1rem 1.6rem 1.1rem 0; overflow: hidden; }
.mod-baul img { width: 100%; height: 100%; max-height: 190px; object-fit: contain; object-position: left center; -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
.mod-baul h2 { margin: 0 0 .5rem; font-family: var(--f-serif); font-weight: 500; font-size: clamp(1.3rem, 2vw, 1.75rem); color: #fff; }
.mod-baul p { margin: 0 0 .9rem; line-height: 1.45; color: #efe6d6; font-size: clamp(.9rem, 1.1vw, 1rem); }
.mod-baul__btn {
	display: inline-flex; align-items: center; gap: .7rem;
	padding: .55rem 1.3rem; border: 1.5px solid var(--an-gold); border-radius: 999px;
	color: var(--an-gold); text-decoration: none; font-size: .98rem; transition: background-color .3s, color .3s;
}
.mod-baul__btn:hover { background: var(--an-gold); color: #1a1208; }
.mod-baul__btn .ico { width: 1.2rem; height: 1.2rem; }

/* Recorrido */
.mod-right { padding: 0; }
.mod-steps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .6rem; }
.mod-steps-head h2 { margin: 0; font-weight: 500; font-size: clamp(1.15rem, 1.7vw, 1.5rem); color: #fff; }
.mod-pct { font-size: .88rem; color: var(--an-gold); }
.mod-bar { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); }
.mod-bar > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #f6a93d, #f7c95b); transition: width .8s var(--an-ease); }
.mod-count { margin: .45rem 0 .9rem; text-align: right; font-size: .85rem; color: #e9dcc4; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.step {
	position: relative;
	display: grid;
	grid-template-columns: clamp(110px, 12vw, 160px) 2.4rem 1fr 2.6rem;
	align-items: center;
	gap: 1rem;
	padding: .55rem 1rem .55rem .55rem;
	border: 1.5px solid rgba(245, 192, 74, .3);
	border-radius: 18px;
	background: linear-gradient(135deg, rgba(36, 26, 17, .9), rgba(18, 13, 10, .92));
	color: inherit;
	text-align: left;
	font: inherit;
	width: 100%;
	cursor: pointer;
	transition: border-color .3s, transform .3s, box-shadow .3s;
}
.step:hover:not([aria-disabled="true"]),
.step:focus-visible { border-color: var(--an-gold); transform: translateX(4px); box-shadow: 0 0 22px rgba(245, 192, 74, .18); }
.step[aria-disabled="true"] { cursor: default; }

.step__thumb { position: relative; aspect-ratio: 158 / 75; border-radius: 10px; overflow: hidden; border: 1px solid rgba(245, 192, 74, .3); background: rgba(255, 255, 255, .06); display: grid; place-items: center; }
.step__thumb img { width: 100%; height: 100%; object-fit: cover; max-width: none; }
.step__thumb span { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .72rem; line-height: 1.15; color: #d8c9ac; text-align: center; padding: .3rem; }
.step__thumb .ico { width: 1.15rem; height: 1.15rem; color: var(--an-gold); }

.step__n { font-weight: 600; font-size: 1.15rem; color: #f2b84a; }
.step__t { font-size: clamp(.92rem, 1.15vw, 1.05rem); line-height: 1.3; color: #f4ead9; }
.step.is-pending .step__t { color: #cbbd9f; }
.step__play { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.8px solid var(--an-gold); color: var(--an-gold); }
.step__play svg { width: 36%; height: 36%; margin-left: 8%; fill: currentColor; }
.step.is-done { border-color: rgba(120, 200, 120, .55); }
.step.is-done .step__n::after { content: " ✓"; color: #8fd28f; }
.step[aria-disabled="true"] .step__play { opacity: .45; }

.mod-foot { margin-top: 1rem; }
.mod-foot img { width: 100%; height: clamp(120px, 14vw, 200px); object-fit: cover; object-position: center bottom; -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%); mask-image: linear-gradient(180deg, transparent, #000 45%); }

/* Reproductor */
.player { width: min(94vw, 960px); padding: 0; border: 1.5px solid rgba(245, 192, 74, .5); border-radius: 18px; background: #0a0807; color: #fff; overflow: hidden; }
.player::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(4px); }
.player__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem; font-size: .95rem; }
.player__bar button { background: none; border: 1.5px solid var(--an-gold); color: var(--an-gold); border-radius: 999px; padding: .35rem 1rem; cursor: pointer; font: inherit; }
.player__frame { aspect-ratio: 16 / 9; background: #000; }
.player__frame iframe,
.player__frame video { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 1000px) {
	.mod-top { grid-template-columns: 1fr auto; }
	.mod-nav { display: none; }
	.mod-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	.mod-label { letter-spacing: .24em; }
	.mod-hero { min-height: 340px; align-items: flex-end; }
	.mod-hero__img { width: 100%; -webkit-mask-image: linear-gradient(0deg, transparent 20%, #000 90%); mask-image: linear-gradient(0deg, transparent 20%, #000 90%); }
	.mod-hero__text { width: 100%; padding: 1.4rem; }
	.mod-hero__lead { max-width: none; }
	.mod-baul { grid-template-columns: 1fr; padding: 1rem 1.2rem 1.4rem; }
	.mod-baul img { max-height: 150px; object-position: center; }
	.step { grid-template-columns: 96px 1.8rem 1fr 2.2rem; gap: .6rem; }
	.step__play { width: 2.2rem; height: 2.2rem; }
}
