/* ============================================================
   opening.css — 水滴 → 波紋 → サイト表示
   sessionStorage で初回のみ。所要 2.5〜3 秒
   ============================================================ */

.opening {
	position: fixed;
	inset: 0;
	z-index: var(--z-opening);
	background: var(--color-bg-washi);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	pointer-events: all;
	transition: opacity 0.5s ease-out;
}

.opening.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.opening.is-removed {
	display: none;
}

/* ───── 水滴 ───── */
.opening__drop {
	position: absolute;
	left: 50%;
	top: -40px;
	width: 16px;
	height: 24px;
	margin-left: -8px;
	background: var(--color-brand-dark);
	border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
	transform: translateY(-100%);
	opacity: 0;
}

.opening.is-playing .opening__drop {
	animation: opening-drop 0.8s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

@keyframes opening-drop {
	0% {
		transform: translateY(-100%);
		opacity: 0;
	}
	20% {
		opacity: 1;
	}
	90% {
		transform: translateY(50vh);
		opacity: 1;
	}
	100% {
		transform: translateY(50vh) scale(0.6, 1.2);
		opacity: 0;
	}
}

/* ───── 波紋（複数の同心円） ───── */
.opening__ripple {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 2px solid var(--color-brand-dark);
	border-radius: 50%;
	opacity: 0;
	transform: scale(0);
}

.opening.is-playing .opening__ripple:nth-child(2) {
	animation: opening-ripple 1.5s ease-out 0.8s forwards;
}
.opening.is-playing .opening__ripple:nth-child(3) {
	animation: opening-ripple 1.5s ease-out 1.0s forwards;
}
.opening.is-playing .opening__ripple:nth-child(4) {
	animation: opening-ripple 1.5s ease-out 1.2s forwards;
}

@keyframes opening-ripple {
	0% {
		transform: scale(0);
		opacity: 1;
		border-width: 2px;
	}
	100% {
		transform: scale(40);
		opacity: 0;
		border-width: 0.5px;
	}
}
