/*
 * Home masthead: a clean, full-bleed cinematic showreel.
 * One key-art scene at a time (the studio, 台股除魔小隊, 秘書可芸, 墨寒), a gold title, two buttons and a slim scene selector.
 * Without JavaScript the first scene simply stays on.
 */

body.home { overflow-x: clip; }

.fh-cine {
	--gold: #f3cf72;
	--ink: #12030a;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	width: 100vw;
	height: clamp(680px, max(88vh, 44vw), 940px);
	margin: 0 0 0 calc(50% - 50vw);
	background: var(--ink);
	color: #fff7e6;
}

/* ── scenes ─────────────────────────────────────────────── */
.fh-cine__slide,
.fh-cine__content {
	visibility: hidden;
	opacity: 0;
	transition: opacity 900ms ease, visibility 0s linear 900ms;
}

.fh-cine__slide.is-active,
.fh-cine__content.is-active { visibility: visible; opacity: 1; transition: opacity 900ms ease, visibility 0s; }

.fh-cine__slide { position: absolute; inset: 0; z-index: 1; }

.fh-cine__slide > img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transform-origin: 50% 22%;
}

.fh-cine__slide.is-active > img { animation: fh-kenburns 16s ease-out both; }

/* darken only the lower-left text zone, never the faces in the upper half */
.fh-cine__shade {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 88% 92% at 0% 100%, rgba(18, 3, 10, .94) 0%, rgba(34, 5, 16, .76) 34%, rgba(34, 5, 16, .18) 64%, transparent 82%),
		linear-gradient(0deg, rgba(14, 2, 8, .95) 0%, rgba(14, 2, 8, .32) 24%, transparent 46%);
}

/* ── copy ───────────────────────────────────────────────── */
.fh-cine__content {
	position: absolute;
	bottom: clamp(112px, 15vh, 150px);
	left: clamp(20px, 6vw, 112px);
	z-index: 6;
	display: grid;
	gap: 12px;
	justify-items: start;
	width: min(1060px, calc(100% - 40px));
}

.fh-cine__content.is-active > * { animation: fh-rise 800ms cubic-bezier(.2, .8, .2, 1) both; }
.fh-cine__content.is-active > :nth-child(2) { animation-delay: 80ms; }
.fh-cine__content.is-active > :nth-child(3) { animation-delay: 160ms; }
.fh-cine__content.is-active > :nth-child(4) { animation-delay: 240ms; }

.fh-cine__kickers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }

.fh-cine__neon {
	display: inline-flex;
	align-items: center;
	gap: .6em;
	margin: 0;
	color: #fff3dc;
	font-size: clamp(.76rem, 1.05vw, .92rem);
	font-weight: 900;
	letter-spacing: .2em;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
}

.fh-cine__neon::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: #ff4a5e; box-shadow: 0 0 10px rgba(255, 74, 94, .9); }

.fh-cine__meta { margin: 0; color: var(--gold); font-size: clamp(.74rem, 1vw, .9rem); font-weight: 850; letter-spacing: .18em; text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }

.fh-cine__title { margin: 0; line-height: 1; }

.fh-cine__zh {
	display: block;
	font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
	font-size: clamp(2.7rem, 6.3vw, 7.2rem);
	font-weight: 900;
	letter-spacing: .02em;
	line-height: 1.04;
	background: linear-gradient(180deg, #fff6d2 0%, #ffd56e 46%, #f2a22e 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 2px 0 #7a3a0c) drop-shadow(0 10px 24px rgba(0, 0, 0, .65));
}

.fh-cine__zh--sm { font-size: clamp(2.4rem, 5.6vw, 6.2rem); }

.fh-cine__tag {
	display: block;
	margin-top: .35em;
	font-family: Georgia, "Noto Serif TC", serif;
	font-size: clamp(1.4rem, 2.8vw, 2.8rem);
	font-weight: 800;
	line-height: 1.12;
	color: #fff5dc;
	text-shadow: 0 4px 22px rgba(0, 0, 0, .75);
}

.fh-cine__en {
	display: block;
	margin-top: .55em;
	font-family: Impact, "Arial Narrow", "Helvetica Neue", sans-serif;
	font-size: clamp(.9rem, 1.7vw, 1.5rem);
	font-weight: 400;
	letter-spacing: .38em;
	color: #ffe9b8;
	text-shadow: 0 2px 14px rgba(0, 0, 0, .85);
}

.fh-cine__quote {
	max-width: 640px;
	margin: 0;
	padding-left: 14px;
	border-left: 3px solid var(--gold);
	color: #ffe9b8;
	font-family: Georgia, "Noto Serif TC", serif;
	font-size: clamp(1.15rem, 2vw, 1.8rem);
	font-weight: 800;
	line-height: 1.4;
	text-shadow: 0 3px 18px rgba(0, 0, 0, .85);
}

.fh-cine__quote small { display: block; margin-top: 4px; color: #f6d99a; font-family: inherit; font-size: .6em; font-weight: 700; letter-spacing: .14em; }

.fh-cine__lead { max-width: 640px; margin: 0; color: rgba(255, 247, 236, .94); font-size: clamp(.98rem, 1.3vw, 1.16rem); line-height: 1.8; text-shadow: 0 2px 14px rgba(0, 0, 0, .85); }

.fh-cine__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.fh-btn {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	box-sizing: border-box;
	min-height: 54px;
	padding: 12px 26px;
	border: 2px solid rgba(255, 233, 170, .9);
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 900;
	letter-spacing: .08em;
	text-decoration: none !important;
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.fh-btn span { font-size: .78em; font-weight: 700; letter-spacing: .12em; opacity: .8; }
.fh-btn:hover, .fh-btn:focus-visible { transform: translateY(-2px); }

.fh-btn--gold { background: linear-gradient(180deg, #ffe9a0, #f4b13c); box-shadow: 0 12px 28px rgba(0, 0, 0, .5); color: #4a0b16 !important; }
.fh-btn--ghost { background: rgba(20, 3, 10, .5); color: #ffeec2 !important; backdrop-filter: blur(6px); }

/* a scene whose subject sits left of centre puts its copy on the right */
.fh-cine__slide--right .fh-cine__shade {
	background:
		radial-gradient(ellipse 88% 92% at 100% 100%, rgba(18, 3, 10, .94) 0%, rgba(34, 5, 16, .76) 34%, rgba(34, 5, 16, .18) 64%, transparent 82%),
		linear-gradient(0deg, rgba(14, 2, 8, .95) 0%, rgba(14, 2, 8, .32) 24%, transparent 46%);
}

.fh-cine__content--right { right: clamp(20px, 6vw, 112px); left: auto; justify-items: end; text-align: right; }
.fh-cine__content--right .fh-cine__kickers,
.fh-cine__content--right .fh-cine__actions { justify-content: flex-end; }
.fh-cine__content--right .fh-cine__quote { padding-right: 14px; padding-left: 0; border-right: 3px solid var(--gold); border-left: 0; }

/* a scene with a key gesture on the left: slide the art right (fading in from the edge) and keep the copy in a narrow column */
.fh-cine__slide--inset > img {
	left: 9%;
	width: 91%;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%);
	mask-image: linear-gradient(90deg, transparent 0, #000 14%);
}

.fh-cine__content--narrow { width: clamp(240px, 20vw, 340px); }
.fh-cine__content--narrow .fh-cine__en { letter-spacing: .24em; }

/* ── scene selector ─────────────────────────────────────── */
.fh-cine__rail {
	position: absolute;
	right: clamp(20px, 6vw, 112px);
	bottom: 30px;
	left: clamp(20px, 6vw, 112px);
	z-index: 7;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(8px, 1.4vw, 20px);
}

.fh-cine__tab {
	position: relative;
	display: grid;
	gap: 6px;
	padding: 14px 4px 0;
	border: 0;
	background: none;
	color: rgba(255, 238, 204, .62);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.fh-cine__tab b { font-family: Impact, "Arial Narrow", sans-serif; font-size: 1.05rem; font-weight: 400; letter-spacing: .12em; color: var(--gold); }
.fh-cine__tab span { font-size: .86rem; font-weight: 800; letter-spacing: .06em; }
.fh-cine__tab:hover, .fh-cine__tab:focus-visible, .fh-cine__tab[aria-selected="true"] { color: #fff7e6; }
.fh-cine__tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.fh-cine__tab i {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 3px;
	overflow: hidden;
	border-radius: 2px;
	background: rgba(255, 233, 170, .28);
}

.fh-cine__tab i::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--gold);
	transform: scaleX(0);
	transform-origin: left;
}

.fh-cine__tab[aria-selected="true"] i::after { animation: fh-progress var(--dur, 8000ms) linear forwards; }
.fh-cine.is-paused .fh-cine__tab[aria-selected="true"] i::after { animation-play-state: paused; }
.fh-cine.is-static .fh-cine__tab[aria-selected="true"] i::after { transform: scaleX(1); animation: none; }

/* ── motion ─────────────────────────────────────────────── */
@keyframes fh-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fh-kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes fh-progress { to { transform: scaleX(1); } }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
	.fh-cine__slide--inset > img { left: 0; width: 100%; -webkit-mask-image: none; mask-image: none; }
	.fh-cine__content--narrow { width: min(1060px, calc(100% - 40px)); }
	.fh-cine__slide--right .fh-cine__shade { background: linear-gradient(0deg, rgba(14, 2, 8, .97) 0%, rgba(30, 4, 14, .84) 38%, rgba(30, 4, 14, .18) 66%, transparent 100%); }
	.fh-cine__content--right { right: auto; left: clamp(20px, 6vw, 112px); justify-items: start; text-align: left; }
	.fh-cine__content--right .fh-cine__kickers, .fh-cine__content--right .fh-cine__actions { justify-content: flex-start; }
	.fh-cine__content--right .fh-cine__quote { padding-right: 0; padding-left: 14px; border-right: 0; border-left: 3px solid var(--gold); }
	.fh-cine { height: clamp(640px, 96svh, 820px); }
	.fh-cine__shade { background: linear-gradient(0deg, rgba(14, 2, 8, .97) 0%, rgba(30, 4, 14, .84) 38%, rgba(30, 4, 14, .18) 66%, transparent 100%); }
	.fh-cine__content { bottom: 98px; gap: 9px; }
	.fh-cine__zh { font-size: clamp(2.3rem, 11vw, 3.6rem); }
	.fh-cine__zh--sm { font-size: clamp(2.1rem, 10vw, 3.3rem); }
	.fh-cine__tag { font-size: 1.3rem; }
	.fh-cine__lead { font-size: .95rem; line-height: 1.7; }
	.fh-cine__actions { width: 100%; }
	.fh-btn { flex: 1 1 100%; justify-content: center; }
	.fh-cine__rail { bottom: 26px; }
	.fh-cine__tab span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.fh-cine *, .fh-cine *::before, .fh-cine *::after { animation: none !important; }
	.fh-cine__slide, .fh-cine__content { transition: none; }
}
