/* ============================================
   Scroll-Driven Animation Demo - Common Styles
   ============================================ */

:root {
	/* Colors */
	--bg: #0a0e17;
	--surface: #111827;
	--surface-2: #1e293b;
	--text: #f1f5f9;
	--text-muted: #94a3b8;
	--accent: #3b82f6;      /* 배경·테두리용 */
	--accent-tx: #60a5fa;   /* 어두운 배경 위 텍스트용 — #3b82f6는 4.3:1로 미달 */
	--accent-2: #8b5cf6;
	--success: #10b981;
	--warning: #f59e0b;

	/* Spacing */
	--container-width: 1100px;
	--section-gap: 100px;

	/* Radius */
	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 20px;
	--radius-xl: 28px;
}

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

html {
	scroll-behavior: smooth;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

/* Container */
.container {
	width: 100%;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 24px;
}

/* Screen-reader-only
   shared.css has this, demo-common.css does not — and this directory loads
   neither, so it is defined here. See CLAUDE.md "스타일 계층". */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Language switch */
.lang-switch {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.lang-switch > div {
	display: flex;
	gap: 6px;
}

.lang-switch--fixed {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 200;
	margin: 0;
}

.lang-btn {
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
	padding: 6px 12px;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--text-muted);
	border-radius: var(--radius-sm);
}

/* Dark text on --accent, not white: white on #3b82f6 is 3.7:1 and misses AA.
   #0a0e17 on #3b82f6 is 5.3:1. See CLAUDE.md "색과 명도 대비". */
.lang-btn[aria-pressed="true"] {
	color: var(--bg);
	background: var(--accent);
	border-color: var(--accent);
	font-weight: 700;
}

.lang-btn:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Skip Link */
.skip-link {
	position: fixed;
	top: -100px;
	left: 16px;
	z-index: 9999;
	padding: 12px 20px;
	background: var(--accent);
	/* Dark on --accent, not white: white on #3b82f6 is 3.7:1 and misses AA.
	   axe never flagged it because the link sits off-screen until focused. */
	color: var(--bg);
	border-radius: var(--radius-sm);
	text-decoration: none;
	font-weight: 700;
	transition: top 0.2s;
}

.skip-link:focus {
	top: 16px;
}

/* Typography */
h1, h2, h3 {
	font-weight: 700;
	line-height: 1.2;
}

h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: clamp(24px, 4vw, 36px); }
h3 { font-size: clamp(18px, 3vw, 24px); }

p {
	color: var(--text-muted);
}

/* Links */
a {
	color: var(--accent-tx);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

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

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 700;
	/* Dark on the gradient, not white. White lands at 3.7:1 over #3b82f6 and
	   4.2:1 over #8b5cf6 — both under AA. #0a0e17 holds 5.3:1 / 4.6:1.
	   axe reports gradient backgrounds as "incomplete" rather than failing, so
	   this one never showed up in a scan. See CLAUDE.md "색과 명도 대비". */
	color: var(--bg);
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	border: none;
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
	text-decoration: none;
}

/* Tags */
.tag {
	display: inline-block;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 500;
	color: #60a5fa;   /* 이 배경(#172846 상당)에서 4.5:1을 넘기려면 --accent(#3b82f6, 4.0:1)로는 부족 */
	background: rgba(59, 130, 246, 0.15);
	border-radius: 100px;
}

/* Cards */
.card {
	background: var(--surface);
	border: 1px solid rgba(148, 163, 184, 0.1);
	border-radius: var(--radius-lg);
	padding: 28px;
}

/* Info Box */
.info-box {
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
	border: 1px solid rgba(59, 130, 246, 0.2);
	border-radius: var(--radius-lg);
	padding: 24px 28px;
}

.info-box h3 {
	font-size: 16px;
	margin-bottom: 12px;
	color: var(--text);
}

.info-box ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.info-box li {
	font-size: 14px;
	color: var(--text-muted);
	padding-left: 20px;
	position: relative;
}

.info-box li::before {
	content: "→";
	position: absolute;
	left: 0;
	color: var(--accent-tx);
}

/*
 * There used to be a `[lang="ko"] { font-size: .9em; color: muted; opacity: .8 }`
 * rule here, styling the parenthetical Korean gloss that sat under every English
 * sentence. The pages now switch language instead of showing both, so the gloss is
 * gone — and the rule had started dimming the `한국어` toggle button, whose own
 * lang="ko" made it inherit opacity .8. That composited its --accent background
 * down to #316bc9 and dropped the label to 3.7:1. Removed rather than re-scoped:
 * with no bilingual glosses left there is nothing for it to style.
 */

/* Responsive */
@media (max-width: 768px) {
	:root {
		--section-gap: 60px;
	}

	.container {
		padding: 0 16px;
	}
}
