/* From. Whale 첫 화면: 파란 바탕에 큰 픽셀 메뉴, 오른쪽 아래 고래 */

@font-face {
	font-family: 'Squaredance';
	src: url('files/SquaredanceFontV1-Regular.ttf') format('truetype');
	font-display: swap;
}

:root {
	color-scheme: dark;
	--blue: #2c5ed6;
	--blue-deep: #173d9e;
	--navy: #0f2a78;
	--ink: #ffffff;
	--sky: #a9c6ff;
	--panel: #1f4bbd;
	--pixel: 'Squaredance', 'Silkscreen', ui-monospace, monospace;
	--sans: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
}

:root:lang(ja) { --sans: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', 'Meiryo', system-ui, sans-serif; }
:root:lang(en) { --sans: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; }
:root:lang(ko) body { word-break: keep-all; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
	margin: 0;
	overflow: hidden;
	background:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
		radial-gradient(ellipse at 30% 30%, #3468e0, var(--blue) 55%, #2556c9);
	color: var(--ink);
	font-family: var(--sans);
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; }

/* ---------- 위 막대 ---------- */
.top {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: calc(18px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 48px) 0;
}

.brand {
	font: 18px var(--pixel);
	letter-spacing: 0.06em;
	text-shadow: 2px 2px 0 var(--blue-deep);
}

.beta {
	display: inline-block;
	margin-left: 10px;
	padding: 3px 6px 1px;
	font: 11px var(--pixel);
	letter-spacing: 0.08em;
	color: var(--blue);
	background: var(--ink);
	text-shadow: none;
	vertical-align: 2px;
}

.langs { display: flex; gap: 2px; }
.langs button {
	font: 13px var(--pixel);
	color: var(--ink);
	background: transparent;
	border: 2px solid rgba(255, 255, 255, 0.55);
	padding: 5px 9px 3px;
	cursor: pointer;
}
.langs button:hover { background: rgba(255, 255, 255, 0.12); }
.langs button.on { background: var(--ink); color: var(--blue); border-color: var(--ink); }

/* ---------- 메뉴 ---------- */
.stage {
	position: relative;
	z-index: 2;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: clamp(18px, 3vh, 34px);
	padding-inline: clamp(16px, 7vw, 120px);
	padding-block: calc(72px + env(safe-area-inset-top, 0px)) calc(32px + env(safe-area-inset-bottom, 0px));
}

.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(10px, 2.2vh, 26px); }

.stage { --big: clamp(52px, 9.5vw, 136px); }

.big {
	position: relative;
	display: inline-block;
	padding-left: calc(var(--big) * 0.62);
	font: var(--big) / 0.95 var(--pixel);
	letter-spacing: 0.02em;
	color: var(--ink);
	text-shadow: 4px 4px 0 var(--blue-deep), 8px 8px 0 rgba(15, 42, 120, 0.35);
	transition: color 0.15s, transform 0.15s, text-shadow 0.15s;
}

/* 옛날 게임 메뉴처럼 깜빡이는 ▶ 커서: 기본은 PLAY, 마우스·키보드가 가는 메뉴로 옮겨 간다 */
.big::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	width: calc(var(--big) * 0.34);
	height: calc(var(--big) * 0.44);
	margin-top: calc(var(--big) * -0.24);
	background: currentColor;
	clip-path: polygon(0 0, 100% 50%, 0 100%);
	filter: drop-shadow(3px 3px 0 var(--blue-deep));
	opacity: 0;
}
.item.play .big::before,
.item:hover .big::before,
.item:focus-within .big::before { opacity: 1; animation: blink 1s steps(2, jump-none) infinite; }
.menu:hover .item:not(:hover) .big::before,
.menu:focus-within .item:not(:focus-within) .big::before { opacity: 0; animation: none; }
@keyframes blink { 50% { opacity: 0; } }

.item:hover .big, .big:focus-visible {
	color: var(--sky);
	transform: translate(-2px, -2px);
	text-shadow: 6px 6px 0 var(--blue-deep), 10px 10px 0 rgba(15, 42, 120, 0.35);
}

.subs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; padding-left: calc(var(--big) * 0.62 + 4px); }
.subs a {
	font: clamp(14px, 1.4vw, 18px) var(--pixel);
	letter-spacing: 0.04em;
	opacity: 0.92;
	border-bottom: 2px solid transparent;
}
.subs a:hover, .subs a:focus-visible { opacity: 1; color: var(--sky); border-bottom-color: currentColor; }

.sound-note {
	margin: 8px 0 0;
	padding-left: calc(var(--big) * 0.62 + 4px);
	font-size: clamp(13px, 1.2vw, 16px);
	font-weight: 700;
	color: var(--sky);
}

.tagline {
	margin: 0;
	padding-left: calc(var(--big) * 0.62 + 4px);
	max-width: calc(36ch + var(--big) * 0.62);
	font-size: clamp(14px, 1.3vw, 17px);
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.85);
	text-wrap: balance;
}

/* ---------- 고래 ---------- */
.whale {
	position: fixed;
	right: clamp(16px, 4vw, 72px);
	bottom: calc(clamp(16px, 4vh, 48px) + env(safe-area-inset-bottom, 0px));
	width: clamp(200px, 28vw, 460px);
	height: auto;
	z-index: 1;
	fill: var(--ink);
	filter: drop-shadow(6px 6px 0 rgba(15, 42, 120, 0.45));
	animation: swim 6s ease-in-out infinite;
	pointer-events: none;
}

@keyframes swim {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-14px) rotate(-1.5deg); }
}

/* ---------- 창 (pitch / concept / contact) ---------- */
.panel {
	position: fixed;
	z-index: 10;
	top: calc(76px + env(safe-area-inset-top, 0px));
	right: clamp(16px, 5vw, 80px);
	max-height: calc(100% - 100px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	width: min(560px, calc(100vw - 32px));
	display: flex;
	flex-direction: column;
	background: var(--panel);
	border: 3px solid var(--ink);
	box-shadow: 8px 8px 0 rgba(15, 42, 120, 0.6);
	animation: pop 0.22s ease-out;
}
.panel[hidden] { display: none; }

@keyframes pop { from { transform: translate(10px, 10px); opacity: 0; } }

.panel-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 10px 6px 14px;
	background: var(--ink);
	color: var(--blue);
	font: 16px var(--pixel);
	letter-spacing: 0.08em;
}

/* ABOUT 창 위쪽의 PITCH | CONCEPT 탭 */
.tabs { display: flex; align-items: center; gap: 6px; }
.tabs button {
	font: 16px var(--pixel);
	letter-spacing: 0.08em;
	color: var(--blue);
	background: transparent;
	border: 0;
	padding: 4px 8px 2px;
	cursor: pointer;
}
.tabs button:hover { text-decoration: underline; text-underline-offset: 4px; }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--blue); text-decoration: none; }
.tab-sep { color: rgba(44, 94, 214, 0.45); font: 16px var(--pixel); }
.panel-body[hidden] { display: none; }

.close {
	font: 700 18px/1 var(--sans);
	color: var(--blue);
	background: transparent;
	border: 0;
	width: 32px; height: 28px;
	cursor: pointer;
}
.close:hover { background: var(--blue); color: var(--ink); }

.panel-body {
	overflow: auto;
	padding: 20px 22px 26px;
	font-size: 15px;
	line-height: 1.8;
}
.panel-body p { margin: 0 0 14px; }
.panel-body h3 { font: 18px var(--pixel); letter-spacing: 0.06em; margin: 22px 0 6px; color: var(--sky); }
.panel-body h3:first-child { margin-top: 0; }
.panel-body ul { margin: 0 0 14px; padding-left: 18px; }
.panel-body li { margin-bottom: 6px; }
.panel-body b { color: var(--ink); }
.panel-body blockquote {
	margin: 22px 0 0;
	padding: 14px 16px;
	border-left: 4px solid var(--sky);
	background: rgba(15, 42, 120, 0.35);
	font-weight: 700;
	line-height: 1.7;
}
.panel-body .play {
	display: inline-block;
	margin-top: 6px;
	padding: 10px 18px 8px;
	font: 16px var(--pixel);
	color: var(--blue);
	background: var(--ink);
	box-shadow: 4px 4px 0 var(--navy);
}
.panel-body .play:hover { background: var(--sky); }

.contacts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 6px 0 0; }
.contacts dt { font: 14px var(--pixel); letter-spacing: 0.06em; color: var(--sky); padding-top: 2px; }
.contacts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.contacts a { border-bottom: 2px solid rgba(255, 255, 255, 0.5); user-select: text; }
.mail { font-weight: 700; user-select: all; -webkit-user-select: all; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.contacts .chip-btn {
	font: 13px var(--sans);
	font-weight: 700;
	color: var(--blue);
	background: var(--ink);
	border: 0;
	border-bottom: 0;
	padding: 6px 12px;
	box-shadow: 3px 3px 0 var(--navy);
	cursor: pointer;
}
.contacts .chip-btn:hover { background: var(--sky); color: var(--navy); }
.contacts .chip-btn.done { background: var(--sky); color: var(--navy); }
.contacts a:hover { color: var(--sky); border-bottom-color: currentColor; }

/* ---------- 휴대폰 ---------- */
@media (max-width: 700px) {
	.stage { justify-content: flex-start; padding-top: calc(110px + env(safe-area-inset-top, 0px)); }
	.stage { --big: clamp(40px, 13.5vw, 68px); }
	.whale { width: 56vw; right: 6vw; bottom: calc(4vh + env(safe-area-inset-bottom, 0px)); }
	.panel { top: calc(64px + env(safe-area-inset-top, 0px)); right: 16px; left: 16px; width: auto; }
}

@media (max-height: 520px) and (orientation: landscape) {
	.stage { justify-content: center; padding-top: 56px; }
	.stage { --big: clamp(36px, 11vh, 64px); }
	.menu ul { gap: 6px; }
	.subs { margin-top: 2px; }
	.tagline { display: none; }
	.whale { width: 26vw; }
}

@media (prefers-reduced-motion: reduce) {
	.whale, .panel, .big::before { animation: none; }
	.big { transition: none; }
}
