/* Homepage hero — front-page only (conditionally enqueued), scoped under .home-hero. */

/* ─── Header floats transparently over the hero (homepage only) ─── */
body.home .head {
	position: absolute;
	top: 0; left: 0; right: 0;
	background: transparent;
	z-index: 30;
}
/* Admin bar: drop the floating header below the WP bar (desktop fixed-height stage only). */
body.admin-bar.home .head { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar.home .head { top: 46px; } }
@media (min-width: 1024px) {
	body.admin-bar .home-hero { height: calc(100vh - 32px); height: calc(100svh - 32px); }
}

/* ─── Stage ─── */
.home-hero {
	position: relative;
	width: 100%;
	min-height: 720px;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	background: var(--color-w-100);
	--hero-card-fit: 1;   /* JS-measured fit — shrinks cards to clear the headline */
	--hero-h-fit: 1;      /* JS-measured fit — shrinks headline only when cards alone can't clear */
}

/* ─── Cinema (animated background) ─── */
.home-hero .cinema { position: absolute; inset: 0; z-index: 1; background: var(--color-w-100); }
.home-hero .cinema-video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ─── Veil & grain ─── */
.home-hero .veil {
	position: absolute; inset: 0; z-index: 2; pointer-events: none;
	background:
		linear-gradient(105deg,
			rgba(244,246,248,.98) 0%,
			rgba(244,246,248,.90) 28%,
			rgba(244,246,248,.66) 58%,
			rgba(244,246,248,.48) 78%,
			rgba(244,246,248,.68) 100%),
		linear-gradient(to bottom,
			rgba(244,246,248,.78) 0%,
			rgba(244,246,248,.24) 30%,
			rgba(244,246,248,.24) 60%,
			rgba(244,246,248,.90) 100%);
}
.home-hero .grain {
	position: absolute; inset: 0; z-index: 3; pointer-events: none;
	opacity: .06; mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ─── Pause / play toggle ─── */
.home-hero .video-toggle {
	position: absolute; z-index: 25;
	bottom: 110px; left: 56px;
	width: 44px; height: 44px;
	border-radius: 50%;
	background: rgba(14,17,19,.06);
	border: 1px solid rgba(14,17,19,.22);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	color: rgba(14,17,19,.85);
	transition: background .25s, border-color .25s, color .25s;
}
.home-hero .video-toggle:hover, .home-hero .video-toggle:focus-visible {
	background: rgba(14,17,19,.12);
	border-color: var(--color-duck);
	color: var(--color-d-30);
	outline: none;
}
.home-hero .video-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.home-hero .video-toggle .pause-icon { display: none; }
.home-hero .video-toggle.is-playing .pause-icon { display: block; }
.home-hero .video-toggle.is-playing .play-icon { display: none; }

/* ─── Hero type ─── */
.home-hero .hero {
	position: absolute; left: 56px; right: 56px;
	top: 50%; transform: translateY(-52%);
	z-index: 20;
	max-width: 1180px;
}
.home-hero .hero-h {
	font-size: calc(clamp(3.2rem, 7.8vw, 8.4rem) * var(--hero-h-fit, 1));
	font-weight: 500; line-height: 1.05; letter-spacing: -.025em;   /* Display spec */
	color: var(--color-d-70);
}
.home-hero .hero-h .ln {
	display: block;
	overflow: hidden;            /* fallback for browsers without overflow:clip */
	overflow: clip;              /* clips the rise, but lets glyphs bleed via clip-margin */
	overflow-clip-margin: 0.18em;
	padding-bottom: .04em;
}
.home-hero .hero-h .c {
	display: inline-block;
	color: var(--color-d-30);
	opacity: 0;
	transform: translateY(102%) scale(.96);
	animation:
		charRise .5s cubic-bezier(.22,.61,.36,1) calc(.04s + var(--i, 0) * 10ms) forwards,
		charColor .34s ease              calc(.14s + var(--i, 0) * 10ms) forwards;
	will-change: transform, opacity, color;
}
.home-hero .hero-h .c-space { display: inline-block; width: .28em; }
@keyframes charRise  { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes charColor { to { color: var(--color-d-70); } }
@keyframes slideUp   { to { transform: translateY(0); } }

.home-hero .hero-wedge {
	margin-top: 24px;
	font-size: clamp(1.4rem, 2.5vw, 2.35rem);
	font-weight: 500; letter-spacing: -.02em; line-height: 1.15;     /* Headline spec */
	color: var(--color-d-70);
	display: block; overflow: hidden;
}
.home-hero .hero-wedge > .w-inner {
	display: inline-block;
	transform: translateY(110%);
	animation: slideUp .85s cubic-bezier(.22,.61,.36,1) 1.40s forwards;
}
.home-hero .mark-bar { position: relative; display: inline-block; padding: 0 .1em; }
.home-hero .mark-bar::before {
	content: '';
	position: absolute;
	left: -.04em; right: -.04em;
	top: .22em; bottom: .04em;
	background: var(--color-duck);
	z-index: -1;
	transform: scaleX(0) scaleY(.22) skew(-3deg) rotate(-.6deg);
	transform-origin: left bottom;
	border-radius: 3px;
	box-shadow: 0 6px 28px rgba(194,210,48,.18);
	animation: inkSpread 1.2s cubic-bezier(.22,.61,.36,1) 1.55s forwards;
}
@keyframes inkSpread {
	0%   { transform: scaleX(0) scaleY(.22) skew(-3deg) rotate(-.6deg); }
	55%  { transform: scaleX(1) scaleY(.22) skew(-3deg) rotate(-.6deg); }
	100% { transform: scaleX(1) scaleY(1)   skew(-3deg) rotate(-.6deg); }
}
.home-hero .mark-bar .mark-ink { color: var(--color-d-90); position: relative; }

.home-hero .hero-promise {
	margin-top: 40px;
	font-size: clamp(1.05rem, 1.4vw, 1.35rem);
	font-weight: 300; line-height: 1.4;                              /* Body: Light weight */
	color: var(--color-d-50); max-width: 46ch;
	letter-spacing: -.005em;
	opacity: 0; transform: translateY(10px);
	animation: rise .9s cubic-bezier(.22,.61,.36,1) 2.10s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ─── Hero actions ─── */
.home-hero .hero-actions {
	margin-top: 40px;
	display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.home-hero .hero-actions .btn-duck {
	opacity: 0; transform: translateY(10px) scale(.96);
	animation: ctaSettle .7s cubic-bezier(.22,.61,.36,1) 2.35s forwards;
}
.home-hero .hero-actions .link-quiet {
	opacity: 0;
	animation: fadeIn .55s ease 2.50s forwards;
}
@keyframes ctaSettle { to { opacity: 1; transform: translateY(0) scale(1); } }

.home-hero .btn-duck {
	display: inline-flex; align-items: center; gap: 11px;
	padding: 18px 34px; border-radius: 9999px;
	background: var(--color-duck); color: var(--color-d-90);
	font-size: 13.5px; font-weight: 600; letter-spacing: .04em;
	position: relative; overflow: hidden;
	transition: letter-spacing .35s cubic-bezier(.22,.61,.36,1),
	            box-shadow .4s ease,
	            transform .35s cubic-bezier(.22,.61,.36,1);
}
.home-hero .btn-duck::before {
	content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
	background: #fff; transition: left .45s cubic-bezier(.22,.61,.36,1);
	z-index: 0;
}
.home-hero .btn-duck:hover::before, .home-hero .btn-duck:focus-visible::before { left: 0; }
.home-hero .btn-duck:hover, .home-hero .btn-duck:focus-visible {
	letter-spacing: .08em;
	transform: translateY(-2px);
	box-shadow: 0 14px 38px rgba(194,210,48,.42);
}
.home-hero .btn-duck > * { position: relative; z-index: 1; }
.home-hero .btn-duck .ar { display: inline-block; transition: transform .35s cubic-bezier(.22,.61,.36,1); }
.home-hero .btn-duck:hover .ar, .home-hero .btn-duck:focus-visible .ar { transform: translateX(6px); }

.home-hero .link-quiet {
	display: inline-flex; align-items: center; gap: 10px;
	font-size: 13px; font-weight: 500; letter-spacing: .04em;
	color: var(--color-d-50);
	padding: 6px 0;
	position: relative;
	transition: color .3s ease;
}
.home-hero .link-quiet::before, .home-hero .link-quiet::after {
	content: ''; position: absolute;
	left: 0; bottom: 0; height: 1px;
}
.home-hero .link-quiet::before { width: 100%; background: rgba(14,17,19,.22); }
.home-hero .link-quiet::after {
	width: 0; background: var(--color-duck);
	transition: width .45s cubic-bezier(.22,.61,.36,1);
}
.home-hero .link-quiet:hover, .home-hero .link-quiet:focus-visible { color: var(--color-d-70); outline: none; }
.home-hero .link-quiet:hover::after, .home-hero .link-quiet:focus-visible::after { width: 100%; }
.home-hero .link-quiet .ar { transition: transform .35s cubic-bezier(.22,.61,.36,1); }
.home-hero .link-quiet:hover .ar, .home-hero .link-quiet:focus-visible .ar { transform: translateY(3px); }

/* ─── Hero work cards (bottom-right) ─── */
.home-hero .hero-cards {
	position: absolute; z-index: 20;
	right: 56px; bottom: 128px;
	display: flex; gap: calc(24px * var(--hero-card-fit, 1));
}
/* Hidden until JS sizes the cards — the fit resize would otherwise register as CLS. (Revealed via .cards-ready.) */
.home-hero .hero-cards { visibility: hidden; }
.home-hero.cards-ready .hero-cards { visibility: visible; }
@media (scripting: none) { .home-hero .hero-cards { visibility: visible; } }
/* Neutralise transforms during JS fit measurement (synchronous, never painted). */
.home-hero.is-measuring .hero-h .c,
.home-hero.is-measuring .strip-card { transform: none !important; }
.home-hero .hero-cards .strip-card {
	opacity: 0; transform: translateX(48px);
	animation: cardSlide .65s cubic-bezier(.22,.61,.36,1) var(--d, 2.55s) forwards;
}
.home-hero .hero-cards .strip-card:nth-child(1) { --d: 2.55s; }
.home-hero .hero-cards .strip-card:nth-child(2) { --d: 2.67s; }
.home-hero .hero-cards .strip-card:nth-child(3) { --d: 2.79s; }
@keyframes cardSlide { to { opacity: 1; transform: translateX(0); } }

.home-hero .strip-card {
	flex: none; width: calc(340px * var(--hero-card-fit, 1));
	text-decoration: none; display: block;
	color: var(--color-d-70);
	background: rgba(14,17,19,.05);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border: 1px solid rgba(14,17,19,.09);
	border-radius: 18px;
	padding: 0 0 20px;
	overflow: hidden;
	transition: background .35s ease, border-color .35s ease,
	            transform .5s cubic-bezier(.22,.61,.36,1),
	            box-shadow .5s ease;
}
.home-hero .strip-card:hover {
	background: rgba(14,17,19,.09);
	border-color: rgba(14,17,19,.2);
	transform: translateY(-6px);
	box-shadow:
		0 22px 50px rgba(194,210,48,.18),
		0 10px 28px rgba(0,0,0,.32);
}
.home-hero .strip-card-img {
	width: 100%; aspect-ratio: 1/1;
	overflow: hidden; border-radius: 0;
	background: var(--color-w-50); position: relative;
}
.home-hero .strip-card-img img {
	width: 100%; height: 100%; object-fit: cover;
	transition: transform .9s cubic-bezier(.22,.61,.36,1);
}
.home-hero .strip-card-img::after {
	content: '';
	position: absolute; top: 14px; right: 14px;
	width: 44px; height: 44px; border-radius: 50%;
	background-color: var(--color-duck);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e1113' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><line x1='7' y1='17' x2='17' y2='7'/><polyline points='8 7 17 7 17 16'/></svg>");
	background-position: center; background-repeat: no-repeat; background-size: 18px;
	box-shadow: 0 8px 22px rgba(0,0,0,.32);
	transform: scale(0) rotate(-45deg);
	opacity: 0;
	transition: transform .55s cubic-bezier(.22,.61,.36,1), opacity .3s ease;
	pointer-events: none;
}
.home-hero .strip-card:hover .strip-card-img img { transform: scale(1.06); }
.home-hero .strip-card:hover .strip-card-img::after { transform: scale(1) rotate(0deg); opacity: 1; }
.home-hero .strip-card-cat {
	margin-top: 16px; padding: 0 18px;
	font-size: 12px; font-weight: 600; text-transform: uppercase;
	letter-spacing: .1em; color: var(--color-d-30);                 /* Label spec */
	display: flex; align-items: center; gap: 10px;
}
.home-hero .strip-card-cat .dot {
	display: inline-block; width: 8px; height: 8px; border-radius: 50%;
	background: var(--color-duck);
}
.home-hero .strip-card-title {
	margin-top: 8px; padding: 0 18px;
	font-size: 19px; font-weight: 600; color: var(--color-d-70);
	letter-spacing: -.015em; line-height: 1.2;
	min-height: 2.4em;                                              /* reserve 2 lines so cards align */
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
	transition: color .2s;
}

/* ─── Hero foot — trust + scroll cue ─── */
.home-hero .hero-foot {
	position: absolute; left: 56px; right: 56px; bottom: 40px; z-index: 20;
	display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
}
.home-hero .hero-trust > * {
	opacity: 0; transform: translateY(8px);
	animation: rise .55s cubic-bezier(.22,.61,.36,1) var(--d, 2.60s) forwards;
}
.home-hero .hero-trust > *:nth-child(1) { --d: 2.60s; }
.home-hero .hero-trust > *:nth-child(2) { --d: 2.67s; }
.home-hero .hero-trust > *:nth-child(3) { --d: 2.74s; }
.home-hero .hero-trust > *:nth-child(4) { --d: 2.81s; }
.home-hero .hero-trust > *:nth-child(5) { --d: 2.88s; }
.home-hero .hero-trust > *:nth-child(6) { --d: 2.95s; }
.home-hero .hero-trust {
	display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
	max-width: 780px;
}
.home-hero .hero-trust .t-stat {
	display: inline-flex; align-items: baseline; gap: 9px;
	font-size: 12.5px; font-weight: 500; color: var(--color-d-50);
	letter-spacing: .01em;
}
.home-hero .hero-trust .t-stat strong {
	font-size: 17px; font-weight: 600; color: var(--color-d-50);    /* d-50 passes AA at this size */
	letter-spacing: -.015em;
}
.home-hero .hero-trust .t-sep { width: 1px; height: 14px; background: rgba(14,17,19,.18); }
.home-hero .hero-trust .t-cert {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 12px; font-weight: 500; color: var(--color-d-50);
	letter-spacing: .01em;
}
.home-hero .hero-trust .t-cert::before {
	content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--color-duck);
	flex-shrink: 0;
}

.home-hero .scroll-cue {
	display: inline-flex; flex-direction: column; align-items: flex-end; gap: 8px;
	font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
	color: var(--color-d-50);
	transition: color .3s;
	opacity: 0; animation: fadeIn .55s ease 3.05s forwards;
}
.home-hero .scroll-cue:hover { color: var(--color-d-70); }
.home-hero .scroll-cue .sc-chapter { font-size: 13px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--color-d-60); }
.home-hero .scroll-cue .sc-chapter strong { color: var(--color-d-30); font-weight: 600; }
.home-hero .scroll-cue .sc-arrow {
	margin-top: 6px; width: 1px; height: 36px;
	background: linear-gradient(to bottom, transparent, var(--color-duck));
	position: relative;
}
.home-hero .scroll-cue .sc-arrow::after {
	content: ''; position: absolute; bottom: 0; left: -3px;
	width: 7px; height: 7px; border-right: 1px solid var(--color-duck); border-bottom: 1px solid var(--color-duck);
	transform: rotate(45deg) translate(-2px,-2px);
}

/* ─── Desktop card count — keep 3 across normal desktop widths; drop to 2 only on small windows ─── */
@media (min-width: 1024px) and (max-width: 1099px) {
	.home-hero .hero-cards .strip-card:nth-child(3) { display: none; }
}

/* ─── Mobile — message block, then a swipeable row of work cards (the proof) ─── */
@media (max-width: 1023px) {
	.home-hero {
		display: flex; flex-direction: column;
		height: auto; min-height: 100svh;       /* fills a screen but free to grow taller — don't cram */
		padding: 132px 0 64px;            /* air under the floating header + bottom */
		gap: 100px;                        /* THE section break — message → work (the one big gap) */
	}
	.home-hero .video-toggle { bottom: 24px; left: 22px; }
	/* Hero owns the primary CTA on mobile — drop the duplicate header pill (home only). */
	body.home .head .h-cta { display: none; }
	/* Pin the canvas to the first screen so the ring centres in the viewport (hero is taller). */
	.home-hero .cinema { bottom: auto; height: 100svh; }
	.home-hero .hero {
		position: static; left: auto; right: auto; top: auto; transform: none;
		max-width: none; margin: 0 22px;
	}
	.home-hero .hero-h { font-size: clamp(2.4rem, 11vw, 4rem); }
	/* Deliberate rhythm — tight marker, breaths, big gap to the work; not uniform. */
	.home-hero .hero-wedge { font-size: clamp(1.15rem, 4.4vw, 1.6rem); margin-top: 20px; }
	.home-hero .hero-promise { margin-top: 40px; font-size: 1.05rem; line-height: 1.55; }
	.home-hero .hero-actions { margin-top: 44px; gap: 18px; }

	/* Work cards → horizontal scroll-snap row; next card peeks to invite the swipe. */
	.home-hero .hero-cards {
		display: flex; position: static; right: auto; bottom: auto;
		gap: 14px;
		overflow-x: auto; overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory; scroll-padding-left: 22px;
		-webkit-overflow-scrolling: touch; scrollbar-width: none;
		padding: 4px 22px 10px;           /* edge inset + room for the lift shadow */
	}
	.home-hero .hero-cards::-webkit-scrollbar { display: none; }
	.home-hero .strip-card {
		width: min(80vw, 320px); flex: 0 0 auto;
		scroll-snap-align: start;
	}
	.home-hero .hero-foot {
		position: static; left: auto; right: auto; bottom: auto;
		margin: 32px 22px 24px;
		flex-direction: column; align-items: flex-start; gap: 18px;
	}
	.home-hero .hero-trust { gap: 14px; }
	.home-hero .hero-trust .t-sep { display: none; }
	.home-hero .scroll-cue { align-self: flex-end; }
}

/* ─── Reduced motion — settle everything, scoped to the hero ─── */
@media (prefers-reduced-motion: reduce) {
	.home-hero *, .home-hero *::before, .home-hero *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
	.home-hero .hero-h .c { opacity: 1 !important; transform: none !important; color: var(--color-d-70) !important; }
	.home-hero .hero-wedge > .w-inner { transform: none !important; }
	.home-hero .mark-bar::before { transform: skew(-3deg) rotate(-.6deg) !important; }
	.home-hero .hero-promise, .home-hero .hero-actions .btn-duck, .home-hero .hero-actions .link-quiet,
	.home-hero .scroll-cue, .home-hero .hero-trust > *, .home-hero .hero-cards .strip-card {
		opacity: 1 !important; transform: none !important;
	}
}

/* ─── Below-hero arrival: footer reveal grammar carried into the body ─── */
.js-reveals .home main .wp-block-columns > .wp-block-column:first-child,
.js-reveals .home main .svc-list .svc { opacity: 0; }
.js-reveals .home main .wp-block-columns.is-in > .wp-block-column:first-child,
.js-reveals .home main .wp-block-columns.is-in .svc {
	opacity: 1;
	animation:
		homeRiseT .6s cubic-bezier(.22,.61,.36,1) backwards,
		homeRiseO .55s ease backwards;
}
.js-reveals .home main .wp-block-columns.is-in .svc:nth-child(1) { animation-delay: .06s; }
.js-reveals .home main .wp-block-columns.is-in .svc:nth-child(2) { animation-delay: .12s; }
.js-reveals .home main .wp-block-columns.is-in .svc:nth-child(n+3) { animation-delay: .18s; }
@keyframes homeRiseT { from { transform: translateY(16px); } }
@keyframes homeRiseO { from { opacity: 0; } }

.js-reveals .home .cards-grid .card { opacity: 0; }
.js-reveals .home .cards-grid.is-in .card {
	opacity: 1;
	animation:
		homeRiseT .6s cubic-bezier(.22,.61,.36,1) backwards,
		homeRiseO .55s ease backwards;
}
.js-reveals .home .cards-grid.is-in .card:nth-child(2) { animation-delay: .06s; }
.js-reveals .home .cards-grid.is-in .card:nth-child(3) { animation-delay: .12s; }
.js-reveals .home .cards-grid.is-in .card:nth-child(n+4) { animation-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
	.js-reveals .home main .wp-block-columns > .wp-block-column:first-child,
	.js-reveals .home main .svc-list .svc,
	.js-reveals .home .cards-grid .card {
		opacity: 1;
		animation: none;
	}
}
