/* --------------------------------------------------------------------------
   About page — "Our Co-Brands" partner cards.

   Loaded only on /about/ (see digimark_enqueue_assets). Everything is scoped to
   .dm-cobrands and prefixed with #primary where it has to outrank the site-wide
   heading rules. Borders are drawn as inset box-shadows because style.css resets
   border-color on every element inside #primary.
   -------------------------------------------------------------------------- */

.dm-cobrands {
	--dm-cb-bg: var(--digimark-background, #0a0c0c);
	--dm-cb-panel: var(--digimark-card, #111413);
	--dm-cb-gold: var(--digimark-gold, #c9a96e);
	--dm-cb-gold-light: #f5e6b8;
	--dm-cb-ink: var(--digimark-foreground, #f5f1e8);
	--dm-cb-muted: var(--digimark-silver, #9a9c97);
	--dm-cb-line: rgb(201 169 110 / 22%);
	--dm-cb-plate: #f7f4ee;
	--dm-cb-ease: cubic-bezier(0.22, 1, 0.36, 1);

	position: relative;
	overflow: hidden;
	padding: clamp(64px, 8vw, 112px) clamp(20px, 5vw, 48px);
	background: var(--dm-cb-bg);
	color: var(--dm-cb-ink);
	font-family: var(--digimark-font-body, "DM Sans", sans-serif);
}

/* Soft gold cast behind the heading. */
.dm-cobrands__glow {
	position: absolute;
	top: 6%;
	left: 50%;
	width: min(1100px, 130%);
	height: 62%;
	translate: -50% 0;
	background: radial-gradient(closest-side, rgb(201 169 110 / 13%), rgb(201 169 110 / 0%));
	pointer-events: none;
}

.dm-cobrands__inner {
	position: relative;
	max-width: 1220px;
	margin: 0 auto;
}

/* ---- Header ------------------------------------------------------------ */

.dm-cobrands__head {
	max-width: 720px;
	margin: 0 auto clamp(40px, 5vw, 64px);
	text-align: center;
}

/* The label's appearance (type, gold, flanking rules) is shared with every other
   eyebrow in style.css - see the "Eyebrow label" section there. This file loads
   after style.css, so a copy here would win; only the spacing belongs here.
   Centring comes from .dm-cobrands__head, which is text-align: center. */
.dm-cobrands__label {
	margin: 0 0 18px;
}

#primary .dm-cobrands__title {
	margin: 0 0 16px;
	color: var(--dm-cb-ink);
	font-family: var(--digimark-font-display, "Space Grotesk", sans-serif);
	font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.75rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.dm-cobrands__accent {
	color: var(--dm-cb-gold-light);
	font-style: italic;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
	.dm-cobrands__accent {
		background: linear-gradient(100deg, var(--dm-cb-gold-light), #e8cf9b 48%, var(--dm-cb-gold));
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
	}
}

.dm-cobrands__sub {
	margin: 0 auto;
	max-width: 58ch;
	color: var(--dm-cb-muted);
	font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
	line-height: 1.7;
}

/* ---- Cards ------------------------------------------------------------- */

.dm-cobrands__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(20px, 2.6vw, 32px);
}

.dm-cobrand {
	position: relative;
	height: 100%;
	border-radius: 24px;
	background: var(--dm-cb-panel);
	box-shadow:
		inset 0 0 0 1px var(--dm-cb-line),
		0 26px 50px -34px rgb(0 0 0 / 85%);
	overflow: hidden;
	transition: transform 520ms var(--dm-cb-ease), box-shadow 520ms var(--dm-cb-ease);
}

/* Scroll reveal: JS adds .is-pre before observing, then .is-in on entry. */
.dm-cobrand.is-pre {
	opacity: 0;
	transform: translateY(26px);
}

.dm-cobrand.is-in {
	opacity: 1;
	transform: none;
	transition: opacity 700ms var(--dm-cb-ease), transform 700ms var(--dm-cb-ease), box-shadow 520ms var(--dm-cb-ease);
}

@media (hover: hover) {
	.dm-cobrand.is-in:hover,
	.dm-cobrand.is-in:focus-within {
		transform: translateY(-8px);
		box-shadow:
			inset 0 0 0 1px rgb(201 169 110 / 55%),
			0 34px 60px -34px rgb(201 169 110 / 35%),
			0 0 44px -20px rgb(201 169 110 / 45%);
	}
}

.dm-cobrand__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

#primary .dm-cobrand__link:focus-visible {
	outline: 2px solid var(--dm-cb-gold);
	outline-offset: 4px;
	border-radius: 24px;
}

/* ---- Banner ------------------------------------------------------------ */

.dm-cobrand__banner {
	position: relative;
	display: grid;
	place-items: center;
	height: 210px;
	overflow: hidden;
	background:
		radial-gradient(120% 95% at 18% 22%, rgb(var(--dm-cb-glow-a) / 48%), rgb(var(--dm-cb-glow-a) / 0%) 62%),
		radial-gradient(120% 95% at 84% 80%, rgb(var(--dm-cb-glow-b) / 42%), rgb(var(--dm-cb-glow-b) / 0%) 64%),
		#0b0d0d;
}

/* Brand-coloured glows, matching each logo. */
.dm-cobrand--logistics {
	--dm-cb-glow-a: 43 58 158;
	--dm-cb-glow-b: 196 170 131;
}

.dm-cobrand--web {
	--dm-cb-glow-a: 31 107 255;
	--dm-cb-glow-b: 47 227 196;
}

/* Faint dotted grid that fades toward the edges. */
.dm-cobrand__dots {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgb(255 255 255 / 18%) 1px, rgb(255 255 255 / 0%) 1.4px);
	background-size: 15px 15px;
	-webkit-mask-image: radial-gradient(115% 95% at 50% 48%, #000 26%, rgb(0 0 0 / 0%) 76%);
	mask-image: radial-gradient(115% 95% at 50% 48%, #000 26%, rgb(0 0 0 / 0%) 76%);
	opacity: 0.5;
	pointer-events: none;
}

/* ---- Themed illustrations --------------------------------------------- */

.dm-cobrand__art {
	position: absolute;
	z-index: 1;
	pointer-events: none;
	width: clamp(34px, 6.4vw, 68px);
	color: rgb(201 169 110 / 55%);
}

.dm-cobrand__art svg {
	display: block;
	width: 100%;
	height: auto;
}

.dm-cobrand__art--ship {
	left: 4.5%;
	bottom: 7%;
	width: clamp(48px, 8vw, 82px);
	color: rgb(196 170 131 / 68%);
	animation: dm-cb-bob 6.5s ease-in-out infinite;
}

.dm-cobrand__art--plane {
	right: 6%;
	top: 11%;
	color: rgb(196 170 131 / 55%);
	animation: dm-cb-drift 9s ease-in-out infinite;
}

.dm-cobrand__art--code {
	left: 5%;
	top: 36%;
	color: rgb(47 227 196 / 45%);
	animation: dm-cb-rise 7s ease-in-out infinite;
}

.dm-cobrand__art--browser {
	right: 5%;
	top: 10%;
	width: clamp(38px, 7vw, 74px);
	color: rgb(31 107 255 / 60%);
	animation: dm-cb-rise 8s ease-in-out infinite;
}

.dm-cobrand__art--phone {
	right: 8%;
	bottom: 8%;
	width: clamp(24px, 4.4vw, 42px);
	color: rgb(47 227 196 / 55%);
	animation: dm-cb-bob 7.5s ease-in-out infinite;
}

.dm-cobrand__art--spark {
	left: 10%;
	bottom: 12%;
	width: clamp(22px, 4vw, 38px);
	color: rgb(201 169 110 / 60%);
	animation: dm-cb-twinkle 5.5s ease-in-out infinite;
}

@keyframes dm-cb-bob {
	0%, 100% { transform: translateY(-3px) rotate(-1deg); }
	50%      { transform: translateY(4px) rotate(1deg); }
}

@keyframes dm-cb-drift {
	0%, 100% { transform: translate(-6px, 3px) rotate(-2deg); }
	50%      { transform: translate(6px, -4px) rotate(2deg); }
}

@keyframes dm-cb-rise {
	0%, 100% { transform: translateY(-4px); }
	50%      { transform: translateY(4px); }
}

@keyframes dm-cb-twinkle {
	0%, 100% { opacity: 0.45; transform: scale(0.9) rotate(0deg); }
	50%      { opacity: 1; transform: scale(1.06) rotate(12deg); }
}

/* ---- Category badge, number and logo plate ---------------------------- */

.dm-cobrand__tag {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 3;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgb(255 255 255 / 8%);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: inset 0 0 0 1px rgb(245 230 184 / 35%);
	color: var(--dm-cb-gold-light);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.dm-cobrand__num {
	position: absolute;
	top: 12px;
	right: 18px;
	z-index: 3;
	color: rgb(245 241 232 / 22%);
	font-family: var(--digimark-font-display, "Space Grotesk", sans-serif);
	font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.75rem);
	font-weight: 600;
	letter-spacing: 0.02em;
}

.dm-cobrand__plate {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 58%;
	padding: clamp(14px, 1.8vw, 19px) clamp(18px, 2.4vw, 26px);
	border-radius: 18px;
	background: var(--dm-cb-plate);
	box-shadow: 0 22px 40px -24px rgb(0 0 0 / 90%);
	animation: dm-cb-float 5s ease-in-out infinite;
}

@keyframes dm-cb-float {
	0%, 100% { transform: translateY(-3px); }
	50%      { transform: translateY(3px); }
}

.dm-cobrand__logo {
	display: block;
	max-width: 100%;
	/* Assets are exported at 2x this, so the plate stays crisp on retina. */
	max-height: clamp(34px, 4vw, 52px);
	width: auto;
	height: auto;
}

.dm-cobrand__logo-fallback {
	color: #16181a;
	font-family: var(--digimark-font-display, "Space Grotesk", sans-serif);
	font-size: 1rem;
	font-weight: 700;
}

/* ---- Card body --------------------------------------------------------- */

.dm-cobrand__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: clamp(22px, 2.6vw, 30px);
}

#primary .dm-cobrand__name {
	margin: 0 0 10px;
	color: var(--dm-cb-ink);
	font-family: var(--digimark-font-display, "Space Grotesk", sans-serif);
	font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.6rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.dm-cobrand__desc {
	margin: 0 0 18px;
	color: var(--dm-cb-muted);
	font-size: 0.95rem;
	line-height: 1.68;
}

.dm-cobrand__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}

.dm-cobrand__chips li {
	padding: 6px 12px;
	border-radius: 999px;
	background: rgb(201 169 110 / 10%);
	box-shadow: inset 0 0 0 1px rgb(201 169 110 / 20%);
	color: rgb(245 230 184 / 88%);
	font-size: 0.78rem;
	font-weight: 500;
	line-height: 1.4;
}

.dm-cobrand__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: auto;
	padding-top: 20px;
	/* Divider line, drawn with a shadow because borders are reset inside #primary. */
	box-shadow: inset 0 1px 0 0 var(--dm-cb-line);
}

.dm-cobrand__domain {
	color: var(--dm-cb-gold);
	font-size: 0.9rem;
	font-weight: 500;
}

.dm-cobrand__arrow {
	display: grid;
	place-items: center;
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	box-shadow: inset 0 0 0 1px rgb(201 169 110 / 45%);
	color: var(--dm-cb-gold);
	transition: background-color 420ms var(--dm-cb-ease), color 420ms var(--dm-cb-ease), box-shadow 420ms var(--dm-cb-ease), transform 420ms var(--dm-cb-ease);
}

.dm-cobrand__arrow svg {
	display: block;
	width: 20px;
	height: 20px;
	transition: transform 420ms var(--dm-cb-ease);
}

@media (hover: hover) {
	.dm-cobrand.is-in:hover .dm-cobrand__arrow,
	.dm-cobrand.is-in:focus-within .dm-cobrand__arrow {
		background: linear-gradient(135deg, var(--dm-cb-gold-light), var(--dm-cb-gold));
		box-shadow: inset 0 0 0 1px rgb(245 230 184 / 60%);
		color: #14110a;
	}

	/* Points up-right on hover: "opens elsewhere". */
	.dm-cobrand.is-in:hover .dm-cobrand__arrow svg,
	.dm-cobrand.is-in:focus-within .dm-cobrand__arrow svg {
		transform: rotate(-45deg);
	}
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 760px) {
	.dm-cobrands__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dm-cobrand__banner {
		height: 170px;
	}

	.dm-cobrand__plate {
		max-width: 74%;
	}

	.dm-cobrand__art--ship {
		width: clamp(42px, 13vw, 66px);
	}

	.dm-cobrand__art--browser {
		width: clamp(34px, 11vw, 58px);
	}
}

/* ---- Reduced motion ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.dm-cobrand,
	.dm-cobrand.is-pre {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.dm-cobrand__plate,
	.dm-cobrand__art,
	.dm-cobrand__art svg,
	.dm-cobrand__arrow,
	.dm-cobrand__arrow svg {
		animation: none;
		transition: none;
		transform: none;
	}

	.dm-cobrand.is-in:hover,
	.dm-cobrand.is-in:focus-within,
	.dm-cobrand.is-in:hover .dm-cobrand__arrow svg,
	.dm-cobrand.is-in:focus-within .dm-cobrand__arrow svg {
		transform: none;
	}
}
