/* TERAFOM 홈페이지 공통 스타일 — 화성 테마 다크 */

:root {
	/* 바탕 — 화성의 밤 */
	--bg: #14100e;
	--bg-raised: #1e1815;
	--bg-sunken: #0d0a09;
	--line: #322822;
	--line-soft: #251e1a;

	/* 글자 */
	--ink: #f4ece5;
	--ink-soft: #c2b3a7;
	--ink-faint: #8d7d72;

	/* 화성 붉은 흙 */
	--rust: #d9552b;
	--rust-bright: #ff7a45;
	--rust-deep: #8f3315;

	/* 정착지 불빛 */
	--glow: #6fd3c7;
	--glow-deep: #1f6b63;
	--sun: #f2b33d;

	/* 크기 */
	--wrap: 1080px;
	--wrap-read: 720px;
	--radius: 14px;
	--radius-sm: 8px;
	--gap: 20px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI",
		system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img {
	max-width: 100%;
	display: block;
}

a {
	color: var(--rust-bright);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

:focus-visible {
	outline: 2px solid var(--glow);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ── 공통 레이아웃 ─────────────────────────────── */

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding-inline: 20px;
}

.wrap-read {
	max-width: var(--wrap-read);
}

.section {
	padding-block: 72px;
	border-top: 1px solid var(--line-soft);
}

.section:first-of-type {
	border-top: none;
}

.eyebrow {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--rust);
	margin: 0 0 12px;
}

h1,
h2,
h3 {
	line-height: 1.3;
	letter-spacing: -0.01em;
	margin: 0 0 16px;
}

h2 {
	font-size: clamp(24px, 4vw, 32px);
	font-weight: 800;
}

h3 {
	font-size: 18px;
	font-weight: 700;
}

p {
	margin: 0 0 16px;
}

.lead {
	font-size: clamp(17px, 2.2vw, 19px);
	color: var(--ink-soft);
	max-width: 60ch;
}

/* ── 머리띠 ────────────────────────────────────── */

.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(20, 16, 14, 0.82);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 60px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--ink);
	font-weight: 800;
	letter-spacing: 0.18em;
	font-size: 15px;
}

.brand:hover {
	text-decoration: none;
	color: var(--rust-bright);
}

.brand-mark {
	width: 24px;
	height: 24px;
	flex: none;
}

.topnav {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.topnav a {
	color: var(--ink-soft);
	font-size: 14px;
	font-weight: 600;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
}

.topnav a:hover {
	color: var(--ink);
	background: var(--bg-raised);
	text-decoration: none;
}

.topnav a[aria-current="page"] {
	color: var(--rust-bright);
}

/* ── 단추 ──────────────────────────────────────── */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 24px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease,
		border-color 0.15s ease;
}

.btn:hover {
	text-decoration: none;
	transform: translateY(-1px);
}

.btn-primary {
	background: linear-gradient(135deg, var(--rust-bright), var(--rust-deep));
	color: #fff;
	box-shadow: 0 6px 24px rgba(217, 85, 43, 0.3);
}

.btn-primary:hover {
	background: linear-gradient(135deg, #ff8d5c, var(--rust));
	color: #fff;
}

.btn-ghost {
	border-color: var(--line);
	color: var(--ink);
	/* 히어로 배경이 비쳐도 글자가 읽히게 옅은 판을 깐다 */
	background: rgba(30, 24, 21, 0.7);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.btn-ghost:hover {
	border-color: var(--rust);
	color: var(--rust-bright);
}

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

/* ── 히어로 ────────────────────────────────────── */

.hero {
	position: relative;
	overflow: hidden;
	padding-block: clamp(56px, 9vw, 104px) clamp(48px, 8vw, 88px);
	background: radial-gradient(
			120% 90% at 78% 8%,
			rgba(217, 85, 43, 0.22),
			transparent 62%
		),
		radial-gradient(90% 70% at 12% 96%, rgba(31, 107, 99, 0.16), transparent 60%),
		var(--bg-sunken);
}

.hero::after {
	/* 화성 지평선 — 글·단추 아래로만 지나가게 낮게 깐다 */
	content: "";
	position: absolute;
	left: -10%;
	right: -10%;
	bottom: -74%;
	height: 90%;
	border-radius: 50% 50% 0 0;
	background: linear-gradient(180deg, #7a3418, #3c1c10 55%, transparent);
	opacity: 0.5;
	pointer-events: none;
}

.hero-inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: clamp(24px, 5vw, 56px);
	align-items: center;
}

.hero h1 {
	font-size: clamp(34px, 7vw, 60px);
	font-weight: 900;
	letter-spacing: -0.02em;
	margin-bottom: 18px;
}

.hero h1 .accent {
	background: linear-gradient(120deg, var(--rust-bright), var(--sun));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.hero-art {
	justify-self: center;
	width: min(320px, 100%);
	filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.5));
}

.badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 26px;
	padding: 0;
	list-style: none;
}

.badges li {
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-soft);
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 5px 13px;
}

/* ── 카드 격자 ─────────────────────────────────── */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
	gap: var(--gap);
	margin-top: 36px;
}

.card {
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
}

.card h3 {
	margin-bottom: 8px;
}

.card p {
	margin: 0;
	color: var(--ink-soft);
	font-size: 15px;
}

.card-icon {
	width: 34px;
	height: 34px;
	margin-bottom: 14px;
	color: var(--rust);
}

/* ── 단계 ──────────────────────────────────────── */

.steps {
	counter-reset: step;
	list-style: none;
	padding: 0;
	margin: 36px 0 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--gap);
}

.steps li {
	counter-increment: step;
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
	position: relative;
}

.steps li::before {
	content: counter(step);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--rust-deep);
	color: #fff;
	font-weight: 800;
	font-size: 15px;
	margin-bottom: 14px;
}

.steps h3 {
	margin-bottom: 6px;
}

.steps p {
	margin: 0;
	color: var(--ink-soft);
	font-size: 15px;
}

/* ── 알림 상자 ─────────────────────────────────── */

.note {
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-left: 3px solid var(--glow);
	border-radius: var(--radius-sm);
	padding: 18px 20px;
	color: var(--ink-soft);
	font-size: 15px;
}

.note strong {
	color: var(--ink);
}

.note :last-child {
	margin-bottom: 0;
}

/* ── 문서 페이지 ───────────────────────────────── */

.doc-head {
	padding-block: 56px 32px;
	border-bottom: 1px solid var(--line-soft);
	background: radial-gradient(
		100% 120% at 50% 0%,
		rgba(217, 85, 43, 0.14),
		transparent 70%
	);
}

.doc-head h1 {
	font-size: clamp(28px, 5vw, 40px);
	font-weight: 800;
	margin-bottom: 10px;
}

.doc-date {
	color: var(--ink-faint);
	font-size: 14px;
	margin: 0;
}

.doc {
	padding-block: 44px 72px;
}

.doc h2 {
	font-size: 21px;
	margin-top: 44px;
	padding-top: 22px;
	border-top: 1px solid var(--line-soft);
}

.doc h2:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.doc h3 {
	font-size: 17px;
	margin-top: 26px;
}

.doc p,
.doc li {
	color: var(--ink-soft);
}

.doc strong {
	color: var(--ink);
	font-weight: 700;
}

.doc ul,
.doc ol {
	padding-left: 22px;
	margin: 0 0 16px;
}

.doc li {
	margin-bottom: 8px;
}

.doc li::marker {
	color: var(--rust);
}

.toc {
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px 24px;
	margin-bottom: 40px;
}

.toc h2 {
	font-size: 14px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin: 0 0 12px;
	padding: 0;
	border: none;
}

.toc ol {
	margin: 0;
	padding-left: 20px;
}

.toc li {
	margin-bottom: 4px;
	color: var(--ink-faint);
}

.doc-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 20px;
	font-size: 15px;
}

.doc-table th,
.doc-table td {
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid var(--line-soft);
	vertical-align: top;
	color: var(--ink-soft);
}

.doc-table th {
	color: var(--ink);
	font-weight: 700;
	white-space: nowrap;
	border-bottom-color: var(--line);
}

.table-scroll {
	overflow-x: auto;
	margin-bottom: 20px;
}

/* ── 꼬리말 ────────────────────────────────────── */

.footer {
	border-top: 1px solid var(--line-soft);
	background: var(--bg-sunken);
	padding-block: 44px;
	font-size: 14px;
	color: var(--ink-faint);
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	justify-content: space-between;
	align-items: flex-start;
}

.footer-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
}

.footer-nav a {
	color: var(--ink-soft);
	font-weight: 600;
}

.footer p {
	margin: 0 0 6px;
}

/* ── 좁은 화면 ─────────────────────────────────── */

@media (max-width: 760px) {
	.hero-inner {
		grid-template-columns: 1fr;
		text-align: center;
	}

	.hero-art {
		order: -1;
		width: min(220px, 70%);
	}

	.lead {
		margin-inline: auto;
	}

	.btn-row,
	.badges {
		justify-content: center;
	}

	.section {
		padding-block: 52px;
	}
}

@media (max-width: 580px) {
	/* 머리띠가 두 줄로 감기지 않게 문서 링크만 남긴다 —
	   게임 소개·시작하기는 히어로의 [게임 살펴보기] 로 갈 수 있다 */
	.nav-anchor {
		display: none;
	}
}

@media (max-width: 420px) {
	.btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.btn:hover {
		transform: none;
	}
}
