@charset "utf-8";
/* CSS Document */

/* ===================================
   กล่องนอก: พื้นหลังไล่สีขยับ
=================================== */
.box-space-all {
	float: left;
	width: 100%;
	height: auto;
	background: linear-gradient(146deg, #152867, #211818, #363636, #555555, #111111);
	background-size: 300% 300%;
	animation: gradient-animation 12s ease infinite;
}

@keyframes gradient-animation {
	0%   { background-position: 0% 50%; }
	50%  { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

/* ===================================
   กล่องใน
=================================== */
.box-space {
	--mx: 0;                     /* ค่าตำแหน่งเมาส์ -1 ถึง 1 (JS ใส่ให้) */
	--my: 0;
	position: relative;
	overflow: hidden;
	float: left;
	width: 100%;
	min-height: clamp(560px, 58vw, 940px);
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 6% 6% 4%;
	box-sizing: border-box;
}

/* ===================================
   ดาว 3 ชั้น เคลื่อนสวนทางจรวด (ซ้ายล่าง) ด้วยความเร็วต่างกัน
=================================== */
.space-stars {
	position: absolute;
	inset: -20%;
	z-index: 0;
	pointer-events: none;
	background-repeat: repeat;
}
.space-stars.s1 {          /* ไกล: เล็ก ช้า */
	background-image:
		radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.6), transparent),
		radial-gradient(1px 1px at 90px 110px, rgba(255,255,255,.5), transparent),
		radial-gradient(1px 1px at 160px 60px, rgba(255,255,255,.4), transparent),
		radial-gradient(1px 1px at 130px 170px, rgba(255,255,255,.5), transparent);
	background-size: 200px 200px;
	opacity: .7;
	transform: translate(calc(var(--mx) * -8px), calc(var(--my) * -8px));
	animation: stars-move 90s linear infinite;
}
.space-stars.s2 {          /* กลาง */
	background-image:
		radial-gradient(1.5px 1.5px at 50px 80px, rgba(255,255,255,.8), transparent),
		radial-gradient(1.5px 1.5px at 220px 40px, rgba(255,255,255,.7), transparent),
		radial-gradient(1.5px 1.5px at 260px 230px, rgba(255,255,255,.6), transparent);
	background-size: 320px 320px;
	transform: translate(calc(var(--mx) * -18px), calc(var(--my) * -18px));
	animation: stars-move 50s linear infinite, stars-twinkle 4s ease-in-out infinite;
}
.space-stars.s3 {          /* ใกล้: ใหญ่ เร็ว */
	background-image:
		radial-gradient(2.5px 2.5px at 120px 140px, rgba(255,255,255,.9), transparent),
		radial-gradient(2px 2px at 380px 320px, rgba(255,255,255,.8), transparent);
	background-size: 520px 520px;
	transform: translate(calc(var(--mx) * -34px), calc(var(--my) * -34px));
	animation: stars-move 24s linear infinite, stars-twinkle 3s ease-in-out 1s infinite;
}
@keyframes stars-move {
	from { background-position: 0 0; }
	to   { background-position: -1040px 1040px; }   /* ลงซ้ายล่าง */
}
@keyframes stars-twinkle {
	0%, 100% { opacity: 1; }
	50%      { opacity: .45; }
}

/* ===================================
   ลูกศรพื้นหลัง ขยับตามเมาส์ + หายใจเบาๆ
=================================== */
.space-arrows {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 1;
	width: 50%;
	height: 100%;
	pointer-events: none;
	background-image: url(../images/bg-arrow-more.png);
	background-repeat: no-repeat;
	background-position: left bottom;
	background-size: 100% auto;
	transform: translate(calc(var(--mx) * 14px), calc(var(--my) * 10px));
	animation: arrows-drift 6s ease-in-out infinite;   /* ใช้ translate/scale แยกจาก transform ของเมาส์ */
}
@keyframes arrows-drift {
	0%, 100% { translate: 0 0;      scale: 1; }
	50%      { translate: 1.2% -1.2%; scale: 1.025; }
}

/* ===================================
   จรวด
=================================== */
.p-space {
	position: absolute;
	top: 2%;
	left: 30%;
	z-index: 2;
	width: 38%;
	pointer-events: none;
	transform: translate(calc(var(--mx) * 26px), calc(var(--my) * 20px));
}
.rocket-fly {
	animation: rocket-loop 11s infinite;
	will-change: transform, opacity;
}
.p-space img {
	display: block;
	width: 100%;
	height: auto;
	animation: rocket-hover 2.2s ease-in-out infinite;
}


/* พุ่งเข้า → ลอยค้าง → ถอยตั้งหลัก → พุ่งออกขวาบน → วนกลับจากซ้ายล่าง */
@keyframes rocket-loop {
	0% {
		transform: translate(-95vw, 60vw) scale(.55);
		opacity: 0;
		animation-timing-function: cubic-bezier(.15, .7, .25, 1);   /* ชะลอตอนเข้า */
	}
	4%  { opacity: 1; }
	24% {
		transform: translate(0, 0) scale(1);
		opacity: 1;
		animation-timing-function: ease-in-out;
	}
	62% {
		transform: translate(0, 0) scale(1);
		animation-timing-function: ease-out;
	}
	68% {
		transform: translate(-3%, 2%) scale(.97);                    /* ถอยตั้งหลัก */
		animation-timing-function: cubic-bezier(.6, 0, .9, .4);      /* เร่งตอนออก */
	}
	86% {
		transform: translate(110vw, -70vw) scale(.6);
		opacity: 1;
	}
	87%, 100% {
		transform: translate(110vw, -70vw) scale(.6);
		opacity: 0;
	}
}
@keyframes rocket-hover {
	0%, 100% { transform: translate(0, 0) rotate(0deg); }
	50%      { transform: translate(0, -2.5%) rotate(-1deg); }
}

/* ===================================
   ข้อความเรียกผู้ชม
=================================== */
.cta-space {
	position: relative;
	z-index: 3;
	width: min(560px, 46%);
	max-width: 100%;
	box-sizing: border-box;
	text-align: center;
	font-family: promptregular;
}

.cta-space,
.cta-space * {
	transform: none;                   /* กันกฎเก่าที่เคยเอียง (skew) */
}

/* สโลแกน */
.slogan {
	margin: 0 0 .45em;
	font-size: clamp(1.9rem, 3.6vw, 3.6rem);
	font-weight: bold;
	line-height: 1.25;
	color: #ffffff;
	text-wrap: balance;
	overflow-wrap: break-word;
	text-shadow: 0 4px 18px rgba(0, 0, 0, .7);
}
.slogan .hl {
	background: linear-gradient(90deg, #ffc61a, #ff5a36, #ff3d7f);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: none;
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .6));
}

/* คำพูดเดิม */
.text-space {
	float: none;
	width: auto;
	margin: 0 0 1.4em;
	font-size: clamp(1rem, 1.35vw, 1.3rem);
	font-weight: normal;
	line-height: 1.7;
	color: #b4b4b4;
	text-wrap: balance;                /* ตัดบรรทัดให้ยาวใกล้เคียงกัน */
	overflow-wrap: break-word;
	text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
}

/* ปรึกษา · สอบถาม ฟรี !! */
.free-text {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: .45em;
	margin: 0 auto 1em;
	padding-top: .8em;
	border-top: 1px solid rgba(255, 255, 255, .15);
	width: fit-content;
	font-size: clamp(1.3rem, 2.4vw, 2.5rem);
	font-weight: bold;
	color: #ffffff;
	text-shadow: 0 3px 12px rgba(0, 0, 0, .6);
}
.free-text .dot {
	width: .22em;
	height: .22em;
	border-radius: 50%;
	background: #8c8c8c;
}
.free-badge {
	display: inline-block;
	padding: .05em .45em .1em;
	border-radius: .25em;
	color: #191919;
	background: #ffc61a;
	text-shadow: none;
	box-shadow: 0 0 0 0 rgba(255, 198, 26, .6);
	animation: free-pulse 1.8s ease-out infinite;
}
@keyframes free-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 198, 26, .6);  scale: 1; }
	15%  { scale: 1.08; }
	30%  { scale: 1; }
	100% { box-shadow: 0 0 0 .6em rgba(255, 198, 26, 0); scale: 1; }
}

/* ปุ่ม */
.cta-buttons {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 14px;
}
.btn-cta {
	display: inline-block;
	padding: .7em 1.8em;
	border-radius: 999px;
	font-size: clamp(1rem, 1.2vw, 1.2rem);
	font-weight: bold;
	text-decoration: none;
	transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.btn-main {
	color: #191919;
	background: #ffffff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.btn-main:hover {
	transform: translateY(-3px);
	background: #ffc61a;
	box-shadow: 0 12px 30px rgba(255, 198, 26, .35);
}
.btn-line {
	color: #ffffff;
	border: 2px solid rgba(255, 255, 255, .55);
	background: rgba(255, 255, 255, .04);
}
.btn-line:hover {
	transform: translateY(-3px);
	border-color: #ffffff;
	background: rgba(255, 255, 255, .12);
}

/* ===================================
   มือถือ
=================================== */
@media (max-width: 767px) {
	.box-space {
		min-height: 0;
		padding: 72vw 6% 12%;      /* เว้นที่ด้านบนให้จรวด */
		justify-content: center;
	}
	.p-space {
		top: 3%;
		left: 15%;
		width: 75%;
	}
	.space-arrows {
		width: 90%;
		opacity: .55;
	}
	.cta-space {
		width: 100%;
		padding: 1.4em 1.1em 1.5em;
		border-radius: 20px;
		/* ไม่ใช้ backdrop-filter บนมือถือ เพราะทำให้จอกะพริบเมื่อมีอนิเมชั่นด้านหลัง */
		background: linear-gradient(180deg, rgba(25, 25, 25, .7), rgba(25, 25, 25, .82));
		border: 1px solid rgba(255, 255, 255, .1);
		box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
	}
	.text-space {
		color: #dcdcdc;                         /* สว่างขึ้นจากเดิม */
	}
	.text-space .br-desktop {
		display: none;                          /* มือถือให้ตัดบรรทัดเอง ไม่ล้น */
	}
	.slogan {
		font-size: 1.65rem;
	}
	.slogan,
	.free-text {
		text-shadow: 0 2px 6px rgba(0, 0, 0, .9);
	}

	/* ===== กันจอกะพริบบนมือถือ =====
	   หยุดอนิเมชั่นที่ต้องวาดหน้าจอใหม่ทุกเฟรม (พื้นหลังไล่สี, ดาวเลื่อน, เงาเรือง)
	   เหลือไว้เฉพาะอนิเมชั่น transform ที่มือถือเล่นได้ลื่น */
	.box-space-all {
		animation: none;
		background-size: 100% 100%;
	}
	.space-stars {
		animation: none !important;
	}
	.space-stars.s3 {
		display: none;
	}
	.space-arrows {
		animation: none;
	}
	.slogan .hl {
		filter: none;
	}
	.free-badge {
		animation: free-pop 1.8s ease-in-out infinite;
		box-shadow: none;
	}
	.box-space,
	.p-space,
	.rocket-fly,
	.cta-space {
		-webkit-backface-visibility: hidden;
		backface-visibility: hidden;
	}
	.p-space {
		transform: translateZ(0);       /* แยกจรวดเป็นเลเยอร์ของตัวเอง */
	}
}

@keyframes free-pop {
	0%, 100% { scale: 1; }
	15%      { scale: 1.08; }
	30%      { scale: 1; }
}

/* ===================================
   ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว
=================================== */
@media (prefers-reduced-motion: reduce) {
	.box-space-all,
	.space-stars,
	.space-arrows,
	.rocket-fly,
	.p-space img,
	.free-badge {
		animation: none !important;
	}
}