/**
 * ipc-reveal — slide-up reveal
 *
 * Mask uses the element's natural line box (no fixed height / padding hacks).
 * Changing height/padding/margin on settle was shifting line spacing (= jitter).
 */

@keyframes ipc-reveal-slide-up {
	from {
		/* Resolved on the animated element; page-hero titles set a larger --ipc-reveal-from */
		transform: translateY(var(--ipc-reveal-from, 100%));
	}

	to {
		transform: translateY(0);
	}
}

.ipc-reveal {
	display: block;
	overflow: hidden;
	/* Natural height = CSS line-height of the text. Never override with a
	   measured px height — that drifts from design leading and jumps on settle. */
}

@supports (overflow: clip) {
	.ipc-reveal:not(.is-reveal-settled) {
		overflow: clip;
		/* Keep 0 while masked — a positive clip-margin lets the top of glyphs
		   peek before/during slide-up. Settled state uses overflow: visible. */
		overflow-clip-margin: 0;
	}
}

/* After the slide-up finishes, only unlock clipping. */
.ipc-reveal.is-reveal-settled {
	overflow: visible;
}

/* Drop compositor transform after settle — leftover translateY(0) from
   animation-fill-mode:both can re-raster text and look like jitter. */
.ipc-reveal.is-reveal-settled .ipc-reveal__inner {
	animation: none !important;
	transform: none !important;
}

.ipc-reveal--inline {
	display: inline-block;
	vertical-align: top;
}

.ipc-reveal__inner {
	display: block;
	transform: translateY(var(--ipc-reveal-from, 100%));
}

.ipc-reveal.is-ready:not([data-reveal-on="view"]):not([data-reveal-on="hero-stats"]):not([data-reveal-on="feature-card"]) .ipc-reveal__inner,
.ipc-reveal.is-ready[data-reveal-on="view"].is-revealed .ipc-reveal__inner,
.ipc-reveal.is-ready[data-reveal-on="hero-stats"].is-revealed .ipc-reveal__inner {
	animation: ipc-reveal-slide-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
	animation-delay: calc(var(--ipc-reveal-delay, 0) * 1s);
}

.ipc-reveal[data-reveal-on="view"]:not(.is-revealed) .ipc-reveal__inner,
.ipc-reveal[data-reveal-on="hero-stats"]:not(.is-revealed) .ipc-reveal__inner,
.ipc-reveal[data-reveal-on="feature-card"]:not(.is-revealed) .ipc-reveal__inner,
.ipc-reveal:not(.is-ready) .ipc-reveal__inner {
	animation: none;
	transform: translateY(var(--ipc-reveal-from, 100%));
}

/* PC page-hero titles: push past serif ink overhang so nothing peeks pre-slide */
@media (min-width: 769px) {
	.ipc-page-hero__title .ipc-reveal {
		--ipc-reveal-from: calc(100% + 0.22em);
	}
}

.ipc-reveal__inner > :first-child {
	margin-top: 0;
}

.ipc-reveal__inner > :last-child {
	margin-bottom: 0;
}

.ipc-intro__title .ipc-reveal:not(.ipc-reveal--inline),
.ipc-section-head .ipc-reveal,
.ipc-section-head__title-mobile .ipc-reveal,
.ipc-final-cta__title .ipc-reveal:not(.ipc-reveal--inline),
.ipc-final-cta__highlight .ipc-reveal,
.ipc-stats__meta .ipc-reveal,
.ipc-feature-card__title .ipc-feature-card__title-reveal,
.ipc-feature-card__title .ipc-reveal:not(.ipc-reveal--inline) {
	display: block;
	width: 100%;
}

/* Voices banner: Figma PC is one tracked line — keep reveal wrappers inline on desktop. */
.ipc-voices-banner__title .ipc-reveal {
	display: inline;
	width: auto;
	height: auto;
	overflow: visible;
	vertical-align: baseline;
}

.ipc-voices-banner__title .ipc-reveal__inner {
	display: inline;
	transform: none;
}

.ipc-voices-banner__title .ipc-reveal.is-ready .ipc-reveal__inner,
.ipc-voices-banner__title .ipc-reveal.is-revealed .ipc-reveal__inner {
	animation: none;
	transform: none;
}

@media (max-width: 768px) {
	.ipc-voices-banner__title .ipc-reveal {
		display: block;
		width: 100%;
	}

	.ipc-voices-banner__title .ipc-reveal__inner {
		display: block;
	}

	/* SP: ボイスバナーの eyebrow を包む reveal ラッパーの transform を無効化。
	   transform が残ると幅 0 のラッパーが containing block となり、
	   eyebrow の left:50% 中央配置が機能しなくなるため。 */
	.ipc-voices-banner__photo .ipc-reveal__inner {
		animation: none !important;
		transform: none !important;
	}
}

.ipc-final-cta__inner > .ipc-reveal-group {
	width: 100%;
}

/* Subpage motion — num-head / section-head reveal (JS-enhanced) */
.ipc-subpage-motion .ipc-approach__title .ipc-reveal--inline,
.ipc-subpage-motion .ipc-contract-types__title .ipc-reveal--inline {
	vertical-align: top;
}

.ipc-subpage-motion .ipc-num-head__en.ipc-reveal,
.ipc-subpage-motion .ipc-section-head__en.ipc-reveal,
.ipc-subpage-motion .ipc-num-head__title.ipc-reveal,
.ipc-subpage-motion .ipc-section-head__title.ipc-reveal,
.ipc-subpage-motion .ipc-approach__title.ipc-reveal,
/* Keep title parts (lead/num/rest) inline — only block-wrap the EN label etc. */
.ipc-subpage-motion .ipc-contract-types__head .ipc-reveal:not(.ipc-reveal--inline),
.ipc-subpage-motion .ipc-related-section__head .ipc-reveal,
.ipc-subpage-motion .ipc-related-section > .ipc-reveal {
	display: block;
	width: 100%;
}

/* Feature-card titles still use a measured mask height for the GSAP path. */
.ipc-feature-card__title-reveal {
	height: var(--ipc-reveal-height, 1em);
	box-sizing: content-box;
}

/* Settled unlock is handled globally via .ipc-reveal.is-reveal-settled (see top of file). */

@media (prefers-reduced-motion: reduce) {
	.ipc-reveal__inner {
		animation: none !important;
		transform: none !important;
	}

	.ipc-reveal {
		overflow: visible;
	}
}
