/**
 * Interactive TAP stamp — shared (About / 就活 / 転職)
 * Figma patterns: 1467:44454 (shukatsu) / 1467:44455 (tenshoku) / 1467:44495… (about)
 */

.c-tap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	width: 297px;
	pointer-events: auto;
}

.c-tap__btn {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	box-sizing: border-box;
	width: 297px;
	height: 297px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	/* No transform on the <button> — iOS Safari compounds % translates
	   and paints a large tap-highlight AABB on rotated controls. */
	-webkit-tap-highlight-color: transparent;
	tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
	touch-action: manipulation;
}

.c-tap__btn *,
.c-tap__stage {
	-webkit-tap-highlight-color: transparent;
}

.c-tap__btn:focus {
	outline: none;
}

.c-tap__btn:focus-visible {
	outline: 2px solid var(--color-primary, #af322c);
	outline-offset: 4px;
	border-radius: 50%;
}

.c-tap__stage {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	transform: rotate(-10.12deg);
	transform-origin: 50% 50%;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.c-tap__disc {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background: #faf5f6;
	transition: background-color 0.35s ease, opacity 0.35s ease;
}

.c-tap__bowl {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 44px;
	height: 50px;
	transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.c-tap__bowl-inner {
	display: block;
	width: 100%;
	height: 100%;
	transform-origin: 50% 70%;
	animation: tokumori-tap-wobble 3.6s ease-in-out infinite;
}

.c-tap__bowl img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
	-webkit-user-drag: none;
}

.c-tap__ring {
	position: absolute;
	inset: 0;
	margin: auto;
	display: block;
	width: 288px;
	height: 288px;
	overflow: visible;
	pointer-events: none;
	transform-origin: 50% 50%;
	animation: tokumori-tap-spin 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.c-tap__ring-text {
	fill: #000;
	font-family: var(--tokumori-font-mobo, var(--tokumori-font-display));
	font-size: clamp(10px, calc(28 * 100vw / 410), 28px);
	font-weight: 700;
	letter-spacing: 0.02em;
	transition: font-size 0.35s ease, letter-spacing 0.35s ease;
}

.c-tap[data-state="1"] .c-tap__disc,
.c-tap[data-state="2"] .c-tap__disc,
.c-tap[data-state="3"] .c-tap__disc {
	background: #faf5f6;
}

.c-tap--about .c-tap__disc,
.c-tap--about[data-state="1"] .c-tap__disc,
.c-tap--about[data-state="2"] .c-tap__disc,
.c-tap--about[data-state="3"] .c-tap__disc {
	background: #fff;
}

/* Default / about / tenshoku growth */
.c-tap[data-state="1"] .c-tap__bowl {
	width: 70px;
	height: 80px;
}

.c-tap[data-state="2"] .c-tap__bowl {
	width: 113px;
	height: 130px;
}

.c-tap[data-state="3"] .c-tap__bowl {
	width: 157px;
	height: 180px;
}

.c-tap[data-state="4"] .c-tap__disc {
	background: transparent;
	opacity: 0;
}

/* Final — Figma: bowl grows; ring stays same size, text wraps full circumference */
.c-tap[data-state="4"] .c-tap__bowl,
.c-tap--about[data-state="4"] .c-tap__bowl,
.c-tap--tenshoku[data-state="4"] .c-tap__bowl,
.c-tap--shukatsu[data-state="4"] .c-tap__bowl {
	width: 200px;
	height: 230px;
}

.c-tap[data-state="4"] .c-tap__ring-text {
	font-size: clamp(10px, calc(22 * 100vw / 410), 22px);
	letter-spacing: 0.02em;
}

.c-tap[data-state="4"] .c-tap__btn {
	cursor: default;
}

.c-tap__cta {
	width: 100%;
	max-width: 280px;
	visibility: hidden;
	opacity: 0;
	transform: translateY(18px) scale(0.96);
	pointer-events: none;
	transition:
		opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
		transform 1s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 1s;
}

.c-tap__cta[hidden] {
	display: block !important;
}

.c-tap__cta.is-visible {
	visibility: visible;
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	transition:
		opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
		transform 1s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 0s;
}

.c-tap__cta-link {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 52px;
	padding: 14px 20px;
	border-radius: 999px;
	background: var(--c-tap-cta-bg, var(--color-primary, #af322c));
	color: #fff;
	font-family: var(--tokumori-font-display);
	font-size: clamp(10px, calc(15 * 100vw / 410), 15px);
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	box-shadow: 0 10px 24px var(--c-tap-cta-shadow, rgba(175, 50, 44, 0.28));
}

/* About — TOKUMORI primary red */
.c-tap--about {
	--c-tap-cta-bg: var(--color-primary, #af322c);
	--c-tap-cta-shadow: rgba(175, 50, 44, 0.28);
}

/* 就活 — hot red */
.c-tap--shukatsu {
	--c-tap-cta-bg: var(--shu-hot, #ff351a);
	--c-tap-cta-shadow: rgba(255, 53, 26, 0.28);
}

/* 転職 — blue */
.c-tap--tenshoku {
	--c-tap-cta-bg: var(--tenshoku-blue, #2e99eb);
	--c-tap-cta-shadow: rgba(46, 153, 235, 0.28);
}

.c-tap__cta-link:hover,
.c-tap__cta-link:focus-visible {
	filter: brightness(1.05);
	color: #fff;
}

@keyframes tokumori-tap-wobble {
	0%,
	58%,
	100% {
		transform: rotate(0deg);
	}
	62% {
		transform: rotate(-14deg);
	}
	66% {
		transform: rotate(12deg);
	}
	70% {
		transform: rotate(-9deg);
	}
	74% {
		transform: rotate(6deg);
	}
	78% {
		transform: rotate(-2deg);
	}
	82% {
		transform: rotate(0deg);
	}
}

@keyframes tokumori-tap-spin {
	0%,
	68% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.c-tap__bowl-inner,
	.c-tap__ring {
		animation: none;
	}

	.c-tap__disc,
	.c-tap__bowl,
	.c-tap__cta {
		transition: none;
	}
}

@media (max-width: 767px) {
	.c-tap {
		width: 222px;
		gap: 16px;
	}

	.c-tap__btn {
		width: 222px;
		height: 222px;
	}

	.c-tap__disc {
		width: 150px;
		height: 150px;
	}

	.c-tap__ring {
		width: 216px;
		height: 216px;
	}

	.c-tap__bowl {
		width: 33px;
		height: 37px;
	}

	.c-tap[data-state="1"] .c-tap__bowl {
		width: 48px;
		height: 55px;
	}

	.c-tap[data-state="2"] .c-tap__bowl {
		width: 77px;
		height: 89px;
	}

	.c-tap[data-state="3"] .c-tap__bowl {
		width: 107px;
		height: 123px;
	}

	.c-tap[data-state="4"] .c-tap__bowl,
	.c-tap--about[data-state="4"] .c-tap__bowl,
	.c-tap--tenshoku[data-state="4"] .c-tap__bowl,
	.c-tap--shukatsu[data-state="4"] .c-tap__bowl {
		width: 136px;
		height: 157px;
	}

	.c-tap__ring-text {
		font-size: clamp(10px, calc(19 * 100vw / 410), 19px);
		letter-spacing: 0.02em;
	}

	.c-tap[data-state="4"] .c-tap__ring-text {
		font-size: clamp(10px, calc(15 * 100vw / 410), 15px);
		letter-spacing: 0.02em;
	}

	.c-tap__cta {
		max-width: 220px;
	}

	.c-tap__cta-link {
		min-height: 44px;
		font-size: clamp(10px, calc(13 * 100vw / 410), 13px);
	}
}
