/*
 * AH Capability Cards. Tilt, glare and reveal come from ah-motion.js (.ah-tilt, .ah-glare, .ah-rv).
 * The reveal moves cards with `translate` so it never fights the tilt's `transform`.
 * Columns: 3, then 2 at 1200px, 1 at 767px (the Columns control overrides).
 */
.ah-caps {
	display: grid;
	grid-template-columns: repeat(var(--ah-caps-cols, 3), minmax(0, 1fr));
	gap: 18px;
	font-family: var(--ah-f-body);
	font-size: 1.0625rem;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
}

.ah-caps .ah-caps__card {
	--ah-cap-bg: var(--ah-paper);
	--ah-cap-line: var(--ah-line);
	--ah-cap-ink: var(--ah-ink);
	--ah-cap-muted: var(--ah-muted);
	--ah-cap-gold: var(--ah-ink-gold);
	--ah-cap-peek: var(--ah-sand);
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	margin: 0;
	padding: 26px 24px 22px;
	border: 1px solid var(--ah-cap-line);
	border-radius: 18px;
	background: var(--ah-cap-bg);
	color: var(--ah-cap-ink);
	transition: transform .5s var(--ah-ease), border-color .35s, box-shadow .45s var(--ah-ease);
}
.ah-caps .ah-caps__card.ah-caps__card--dark {
	--ah-cap-bg: var(--ah-navy);
	--ah-cap-line: var(--ah-navy);
	--ah-cap-ink: var(--ah-on-navy);
	--ah-cap-muted: var(--ah-on-navy-muted);
	--ah-cap-gold: var(--ah-gold-hi);
	--ah-cap-peek: #13204A;
}
.ah-caps .ah-caps__card:hover { border-color: rgba(197, 165, 114, .7); box-shadow: 0 26px 50px -34px rgba(9, 18, 42, .55); }
.ah-caps .ah-caps__card.ah-caps__card--dark:hover { border-color: rgba(232, 201, 136, .45); box-shadow: 0 26px 50px -30px rgba(9, 18, 42, .8); }
/* while the pointer drives the tilt it follows fast (same as ah-base), the rest keeps easing */
.ah-caps .ah-caps__card.ah-tilt.is-tilting { transition: transform .08s linear, border-color .35s, box-shadow .45s var(--ah-ease); }

.ah-caps .ah-caps__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ah-caps .ah-caps__top .ah-itile { translate: calc(var(--mx, 0) * 8px) calc(var(--my, 0) * 6px); transition: transform .5s var(--ah-spring), translate .5s var(--ah-ease), box-shadow .5s; }
.ah-caps .ah-caps__card:hover .ah-itile { transform: rotate(calc(var(--ah-dir) * 6deg)) scale(1.08); }
.ah-caps .ah-caps__no { font-family: var(--ah-f-mono); font-size: .78rem; line-height: 1.6; color: var(--ah-cap-gold); }

.ah-caps .ah-caps__title {
	margin: 0;
	font-family: var(--ah-f-display);
	font-weight: 800;
	font-size: 1.28rem;
	line-height: 1.4;
	letter-spacing: 0;
	color: inherit;
	text-wrap: balance;
}
.ah-caps .ah-caps__title .ah-caps__link { color: inherit; text-decoration: none; background: none; }
.ah-caps .ah-caps__title .ah-caps__link:hover { color: inherit; }
/* stretched link: the whole card is the target, above the glare */
.ah-caps .ah-caps__link::before { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; }
.ah-caps .ah-caps__link:focus-visible { outline: none; }
.ah-caps .ah-caps__card:has(.ah-caps__link:focus-visible) { outline: 2px solid var(--ah-gold); outline-offset: 3px; }
@supports not selector(:has(*)) {
	.ah-caps .ah-caps__link:focus-visible { outline: 2px solid var(--ah-gold); outline-offset: 3px; }
}

.ah-caps .ah-caps__text { margin: 0; font-size: .94rem; line-height: 1.75; color: var(--ah-cap-muted); }

/* image peek and proof line sit at the bottom, so they line up across a row */
.ah-caps .ah-caps__foot { display: grid; gap: 12px; margin-block-start: auto; }
.ah-caps .ah-caps__peek {
	position: relative;
	aspect-ratio: 2.9;
	margin: 0;
	border-radius: 12px;
	overflow: hidden;
	background: var(--ah-cap-peek);
}
.ah-caps .ah-caps__peek .ah-caps__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center top;
	scale: 1.1;
	translate: calc(var(--mx, 0) * -14px) calc(var(--my, 0) * -10px);
	transition: transform .9s var(--ah-ease), translate .5s var(--ah-ease);
}
.ah-caps .ah-caps__card:hover .ah-caps__img { transform: scale(1.06); }
.ah-caps .ah-caps__cap {
	position: absolute;
	bottom: 8px;
	inset-inline-start: 8px;
	max-width: calc(100% - 16px);
	padding: 2px 10px;
	border-radius: 999px;
	background: rgba(9, 18, 42, .86);
	color: var(--ah-on-navy);
	font-size: .72rem;
	line-height: 1.6;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ah-caps .ah-caps__proof {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0;
	padding-block-start: 10px;
	border-top: 1px dashed var(--ah-cap-line);
	font-family: var(--ah-f-mono);
	font-size: .78rem;
	line-height: 1.6;
	color: var(--ah-cap-gold);
}
.ah-caps .ah-caps__card--dark .ah-caps__proof { border-top-color: var(--ah-line-navy); }
.ah-caps .ah-caps__pf { unicode-bidi: isolate; }
.ah-caps .ah-caps__proof .ah-btn__arr { flex: none; width: 15px; height: 15px; margin-inline-start: auto; transition: translate .35s var(--ah-ease); }
[dir="rtl"] .ah-caps .ah-caps__proof .ah-btn__arr { scale: -1 1; }
.ah-caps .ah-caps__card--link:hover .ah-btn__arr { translate: calc(var(--ah-dir) * 5px) 0; }

/* reveal: cards rise one after another in each row (translate, not transform: the tilt owns transform) */
.ah-motion .ah-caps .ah-caps__card.ah-rv {
	opacity: 0;
	translate: 0 22px;
	transition: opacity .9s var(--ah-ease) calc(var(--i, 0) * 90ms), translate .9s var(--ah-ease) calc(var(--i, 0) * 90ms), transform .5s var(--ah-ease), border-color .35s, box-shadow .45s var(--ah-ease);
}
.ah-motion .ah-caps .ah-caps__card.ah-rv.seen { opacity: 1; translate: none; }
.ah-motion .ah-caps .ah-caps__card.ah-rv.seen.is-tilting { transition: transform .08s linear, border-color .35s, box-shadow .45s var(--ah-ease); }

@media (prefers-reduced-motion: reduce) {
	.ah-caps .ah-caps__card,
	.ah-caps .ah-caps__img,
	.ah-caps .ah-caps__top .ah-itile { transition: none; }
	.ah-caps .ah-caps__card:hover .ah-itile,
	.ah-caps .ah-caps__card:hover .ah-caps__img { transform: none; }
	.ah-motion .ah-caps .ah-caps__card.ah-rv { opacity: 1; translate: none; transition: none; }
}

@media (max-width: 1200px) {
	.ah-caps { grid-template-columns: repeat(var(--ah-caps-cols, 2), minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.ah-caps { grid-template-columns: repeat(var(--ah-caps-cols, 1), minmax(0, 1fr)); gap: 14px; }
	.ah-caps .ah-caps__card { padding: 22px 20px 18px; }
	.ah-caps .ah-caps__peek { aspect-ratio: 2.3; }
}
