/**
 * The Partners page as an alliance matrix and coalition hub
 * (page-partners.php). Loaded on that page only; a page transition that
 * brings the page in loads it first (page-transitions.js). Behaviour:
 * assets/js/alliance.js.
 *
 *   1. Frame: tokens, glass nodes, labels, the coalition bar
 *   2. Gateway: the gathering title, the standfirst, the signal monitor
 *   3. Alliance matrix: the filter, the bento of alliance cards
 *   4. Value exchange: two rails paired across a spine
 *   5. Handshake: the steps under their sequence of exchanges
 *   6. Protocol terminal: the request form, raised
 *   7. Entrances: from first paint, and after a page transition
 *   8. Responsive
 *
 * Where /vision is an editorial dossier and /business an instrument, this
 * page is a constellation: light type, rounder glass that lets the globe
 * through, and nodes and links as the only ornament (a node at each
 * corner of a card instead of crosshairs, insignia drawn as small
 * constellations, packets crossing between the rails). Every rule is
 * scoped to .dru-alliance, and the page is complete without JS: the
 * formats then read as four open cards and the rails as two lists.
 */

/* ==========================================================================
   1. Frame
   ========================================================================== */

.dru-alliance {
	--al-gap: clamp(0.875rem, 1.4vw, 1.25rem);
	--al-pad: clamp(1.5rem, 2.3vw, 2.125rem);
	--al-frame: min(100% - 2 * var(--gutter), var(--page-max) - 2 * var(--gutter));
	--al-glass: rgba(8, 12, 24, 0.6);
	--al-glass-strong: rgba(8, 12, 24, 0.86);
	--al-blur: blur(22px) saturate(160%);
	--al-line: rgba(255, 255, 255, 0.08);
	--al-radius: 22px;
	--al-label: 500 0.6875rem/1.3 var(--mono);
	--al-strip: 3.5rem;
	--al-spine: clamp(4.5rem, 9vw, 8rem);
	counter-reset: alliance;
}

/* Sections, numbered NODE_01–NODE_04 wherever the content nests them. */
.dru-alliance section {
	position: relative;
	counter-increment: alliance;
}

/* Glass nodes: the cards, rows and panels of the page. Rounder than the
   site's glass, a light along the top edge, a node at each corner instead
   of crosshairs. --cross-img and --spot-glow are declared here, on each
   element, so its own --node and --mouse-x / --mouse-y reach them (the
   :root note in DESIGN.md); .dru-spot layers them (style.css). */
.dru-alliance.dru-main :is(
	.dru-value__col,
	.dru-ledger > *,
	.dru-steps > *,
	.dru-alliance__monitor
) {
	--node: rgba(0, 240, 255, 0.75);
	--cross-img:
		radial-gradient(circle, var(--node) 0 1.5px, transparent 2.5px),
		radial-gradient(circle, var(--node) 0 1.5px, transparent 2.5px),
		radial-gradient(circle, var(--node) 0 1.5px, transparent 2.5px),
		radial-gradient(circle, var(--node) 0 1.5px, transparent 2.5px),
		linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent),
		none, none, none;
	--spot-glow: radial-gradient(460px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(0, 240, 255, 0.09), transparent 45%);
	position: relative;
	border: 1px solid var(--al-line);
	border-radius: var(--al-radius);
	background-color: var(--al-glass);
	background-image: none, var(--cross-img);
	background-position:
		0 0,
		left 11px top 11px, right 11px top 11px,
		left 11px bottom 11px, right 11px bottom 11px,
		50% 0, 0 0, 0 0, 0 0;
	background-size:
		auto,
		6px 6px, 6px 6px, 6px 6px, 6px 6px,
		64% 1px, auto, auto, auto;
	background-repeat: no-repeat;
	-webkit-backdrop-filter: var(--al-blur);
	backdrop-filter: var(--al-blur);
	box-shadow: 0 40px 90px -60px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Section labels: NODE_NN // CODE, from the page's own count. */
.dru-alliance .dru-value { --eyebrow-label: "ALLIANCE_MATRIX"; }
.dru-alliance .dru-exchange { --eyebrow-label: "VALUE_EXCHANGE"; }
.dru-alliance .dru-join:has(.dru-steps) { --eyebrow-label: "HANDSHAKE"; }
.dru-alliance .dru-join:has(.dru-join__form) { --eyebrow-label: "PROTOCOL_TERMINAL"; }

.dru-alliance :is(.dru-value__statement > h2, .dru-section-head > h2, .dru-join__aside h2)::before {
	counter-increment: none;
	content: "NODE_" counter(alliance, decimal-leading-zero) " // " var(--eyebrow-label);
	content: "NODE_" counter(alliance, decimal-leading-zero) " // " var(--eyebrow-label) / "";
	display: block;
	margin-bottom: 1.25rem;
	color: var(--cyan);
	font: var(--al-label);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Section headings: light and wide open, the page's display voice. */
.dru-alliance :is(.dru-value__statement > h2, .dru-section-head > h2) {
	color: #FFFFFF;
	font-size: clamp(2.25rem, 4vw, 3.75rem);
	font-weight: 300;
	line-height: 1.02;
	letter-spacing: -0.045em;
}

/* The coalition bar under the HUD: a star, the hub's codes, the count of
   the globe's constellation (alliance.js). */
.dru-alliance__bar {
	position: absolute;
	top: calc(var(--header-h) + 0.5rem);
	left: 0;
	right: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: clamp(0.75rem, 1.4vw, 1.25rem);
	width: var(--al-frame);
	margin-inline: auto;
	color: var(--muted);
	font: var(--al-label);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
}

.dru-alliance__led {
	position: relative;
	flex: none;
	width: 11px;
	height: 11px;
	background:
		linear-gradient(var(--cyan), var(--cyan)) 50% 50% / 1px 100% no-repeat,
		linear-gradient(var(--cyan), var(--cyan)) 50% 50% / 100% 1px no-repeat,
		radial-gradient(circle, #FFFFFF 0 1.5px, rgba(0, 240, 255, 0.45) 2px, transparent 5.5px);
}

.dru-alliance__tag:nth-child(2) {
	color: var(--gold);
}

.dru-alliance__tag:nth-child(3) {
	color: var(--on-dark-muted);
}

/* A star chart's dotted rule. */
.dru-alliance__rule {
	flex: 1 1 auto;
	min-width: 1.5rem;
	height: 2px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 1px, transparent 1.2px) 0 50% / 8px 2px repeat-x;
	transform-origin: left center;
}

.dru-alliance__count {
	color: var(--on-dark);
	font-variant-numeric: tabular-nums;
}

.dru-alliance__count:empty {
	display: none;
}

/* ==========================================================================
   2. Gateway
   ========================================================================== */

.dru-alliance .dru-trust {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: calc(100svh - var(--header-h));
	padding-block: 6rem clamp(2rem, 5vh, 3.5rem);
	border: 0;
	background: none;
	isolation: isolate;
}

/* A sparse field of points behind the title, fading out from it. */
.dru-alliance .dru-trust::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0 1px, transparent 1.5px);
	background-size: 30px 30px;
	-webkit-mask-image: radial-gradient(52% 58% at 24% 50%, #000 0%, transparent 78%);
	mask-image: radial-gradient(52% 58% at 24% 50%, #000 0%, transparent 78%);
	pointer-events: none;
}

.dru-alliance .dru-trust > .dru-wrap {
	row-gap: 0;
	align-content: center;
}

.dru-alliance .dru-trust h1 {
	grid-column: 1 / span 7;
	grid-row: 1;
	max-width: none;
	color: #FFFFFF;
	font-size: clamp(2.75rem, 5.8vw, 5.75rem);
	font-weight: 300;
	line-height: 1;
	letter-spacing: -0.05em;
	animation: none;
}

/* Letters (dru_alliance_title()): words stay whole, letters move alone. */
.dru-alliance__title {
	display: block;
}

.dru-alliance__word {
	display: inline-block;
	white-space: nowrap;
}

.dru-alliance__char {
	display: inline-block;
}

.dru-alliance .dru-trust .dru-trust__standfirst {
	grid-column: 1 / span 6;
	grid-row: 2;
	max-width: 34rem;
	margin-top: clamp(1.5rem, 3.5vh, 2.25rem);
	color: var(--ink);
	font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
	line-height: 1.55;
	animation: none;
}

.dru-alliance .dru-trust .dru-trust__actions {
	grid-column: 1 / -1;
	grid-row: 3;
	padding-top: clamp(1.5rem, 3.5vh, 2.25rem);
}

/* The signal monitor: the globe's packets as they land (alliance.js).
   Positioned over the glass-node rule's relative positioning. */
.dru-alliance.dru-main .dru-alliance__monitor {
	position: absolute;
	right: calc((100% - var(--al-frame)) / 2);
	/* Clear of the dock's call to action in the corner below. */
	bottom: clamp(6rem, 14vh, 8.5rem);
	width: min(20rem, 32vw);
	padding: 1rem 1.25rem 1rem;
	border-radius: 16px;
	color: var(--muted);
	font: var(--al-label);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.dru-alliance__monitor-head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.625rem;
	border-bottom: 1px solid var(--al-line);
	color: var(--on-dark-muted);
	letter-spacing: 0.16em;
}

.dru-alliance__live {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--success);
}

.dru-alliance__live::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 8px currentColor;
}

/* Four rows of one line each: the log never changes height. Set a size
   down and tight, so the longest route (НЬЮ-ЙОРК → КРЕМНІЄВА ДОЛИНА and
   its stamp) fits a row at every width. */
.dru-alliance__log {
	display: grid;
	grid-template-rows: repeat(4, 1.3em);
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	font-size: 0.625rem;
	letter-spacing: 0.04em;
	list-style: none;
}

.dru-alliance__log > li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	overflow: hidden;
	white-space: nowrap;
}

.dru-alliance__log > li:first-child {
	color: #FFFFFF;
}

.dru-alliance__log > li:nth-child(2) { opacity: 0.7; }
.dru-alliance__log > li:nth-child(3) { opacity: 0.45; }
.dru-alliance__log > li:nth-child(4) { opacity: 0.25; }

/* Waiting: the first row says so, in grey; empty rows show nothing. */
.dru-alliance__log > li.is-empty {
	color: var(--muted);
}

.dru-alliance__log > li.is-empty:not(:first-child) .dru-alliance__route::before {
	display: none;
}

.dru-alliance__route::before {
	content: "";
	display: inline-block;
	width: 5px;
	height: 5px;
	margin-right: 0.55rem;
	border-radius: 50%;
	background: var(--cyan);
	box-shadow: 0 0 6px var(--cyan);
	vertical-align: 0.1em;
}

.dru-alliance__stamp {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3. Alliance matrix
   ========================================================================== */

/* The filter: all four formats, or one in focus (alliance.js). */
.dru-alliance__filter {
	position: relative;
	display: flex;
	width: var(--al-frame);
	margin: clamp(2.5rem, 5vw, 4rem) auto var(--al-gap);
	padding: 0.375rem;
	border: 1px solid var(--al-line);
	border-radius: 999px;
	background-color: rgba(8, 12, 24, 0.55);
	-webkit-backdrop-filter: var(--al-blur);
	backdrop-filter: var(--al-blur);
}

.dru-alliance__seg {
	position: relative;
	z-index: 1;
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	min-width: 0;
	min-height: 3rem;
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--on-dark-muted);
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.2;
	text-align: left;
	cursor: pointer;
	transition: color 0.35s var(--ease);
}

.dru-alliance__seg:hover,
.dru-alliance__seg[aria-pressed="true"] {
	color: #FFFFFF;
}

.dru-alliance__seg:focus-visible {
	outline: 2px solid var(--cyan);
	outline-offset: 2px;
}

.dru-alliance__seg-num {
	flex: none;
	color: var(--cyan);
	font: var(--al-label);
	letter-spacing: 0.12em;
}

.dru-alliance__seg[aria-pressed="true"] .dru-alliance__seg-num {
	color: var(--gold);
}

/* The beam over the segment chosen (alliance.js measures it). */
.dru-alliance__beam {
	position: absolute;
	top: 0;
	left: 0;
	width: var(--beam-w, 0);
	height: var(--beam-h, 0);
	border-radius: 999px;
	background: linear-gradient(100deg, rgba(0, 240, 255, 0.16), rgba(255, 208, 0, 0.09));
	box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.35), 0 0 32px -10px rgba(0, 240, 255, 0.6);
	transform: translate3d(var(--beam-x, 0), var(--beam-y, 0), 0);
	transition: transform 0.6s var(--ease), width 0.6s var(--ease), height 0.6s var(--ease);
	pointer-events: none;
}

/* The bento: staggered widths, rows of equal height. */
.dru-alliance .dru-value .dru-value__grid {
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--al-gap);
	margin-top: 0;
}

.dru-alliance .dru-value__col {
	grid-column: span 6;
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	min-height: 0;
	padding: var(--al-pad);
	overflow: hidden;
	isolation: isolate;
	/* Never opacity or transform: GSAP owns those (their entrance), and a
	   transition would restart under every tween frame. */
	transition: border-color 0.5s var(--ease), background-color 0.5s var(--ease);
}

@media (min-width: 1200px) {
	.dru-alliance .dru-value__col:nth-child(4n + 1),
	.dru-alliance .dru-value__col:nth-child(4n + 4) {
		grid-column: span 7;
	}

	.dru-alliance .dru-value__col:nth-child(4n + 2),
	.dru-alliance .dru-value__col:nth-child(4n + 3) {
		grid-column: span 5;
	}
}

.dru-alliance .dru-value__col:hover,
.dru-alliance .dru-value__col:focus-within,
.dru-alliance .dru-value__col.is-focus {
	border-color: rgba(0, 240, 255, 0.28);
	background-color: rgba(10, 16, 32, 0.68);
}

.dru-alliance .dru-value__col.is-focus {
	--node: var(--gold);
	box-shadow: 0 50px 110px -60px rgba(0, 240, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* The other formats while one is in focus: a veil over them (the card's
   own opacity is its entrance's). */
.dru-alliance .dru-value__col::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: inherit;
	background: rgba(5, 6, 11, 0.62);
	opacity: 0;
	transition: opacity 0.5s var(--ease);
	pointer-events: none;
}

.dru-alliance .dru-value__grid.is-filtered > .dru-value__col:not(.is-focus)::before {
	opacity: 1;
}

.dru-alliance .dru-value__grid.is-filtered > .dru-value__col:not(.is-focus):hover::before {
	opacity: 0.45;
}

/* The crest: the format's insignia, its node, its topology. */
.dru-alliance__crest {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 0.5rem;
	color: var(--muted);
	font: var(--al-label);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.dru-alliance__sigil {
	flex: none;
	width: 3.25rem;
	height: 3.25rem;
	overflow: visible;
}

.dru-alliance__sigil .is-edge {
	fill: none;
	stroke: rgba(0, 240, 255, 0.42);
	stroke-width: 1;
}

.dru-alliance__sigil .is-wave {
	fill: none;
	stroke: rgba(255, 208, 0, 0.35);
	stroke-width: 1;
}

/* Packets: dots that run their links while the card is lit (section 7). */
.dru-alliance__sigil .is-packet {
	fill: #FFFFFF;
	opacity: 0;
}

.dru-alliance__sigil .is-node {
	fill: #0A1222;
	stroke: var(--cyan);
	stroke-width: 1;
}

.dru-alliance__sigil .is-core {
	fill: var(--gold);
	stroke: none;
}

/* The core's glow: a translucent disc (an SVG filter's first raster is
   slow). */
.dru-alliance__sigil .is-halo {
	fill: rgba(255, 208, 0, 0.22);
}

.dru-alliance__crest-text {
	display: grid;
	gap: 0.4rem;
	padding-top: 0.3rem;
}

.dru-alliance__node {
	color: var(--cyan);
}

.dru-alliance__topo {
	color: var(--on-dark-muted);
}

.dru-alliance .dru-value__col.is-focus .dru-alliance__node {
	color: var(--gold);
}

.dru-alliance .dru-value__col h3 {
	color: #FFFFFF;
	font-size: clamp(1.5rem, 2.1vw, 2rem);
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: -0.03em;
}

.dru-alliance .dru-value__col p:not(.dru-more) {
	max-width: 36rem;
	color: var(--ink);
	font-size: 1rem;
	line-height: 1.55;
}

/* The card's face (its description, what it lights on the globe) and its
   node profile (the joint objectives and the action): one after the other
   by default (touch screens, no JS), swapping in one place where the card
   can be hovered (alliance.js adds .has-drawers). */
.dru-alliance__swap {
	display: grid;
	gap: 1.25rem;
}

.dru-alliance__face {
	display: grid;
	align-content: start;
	gap: 1rem;
}

/* What the format lights on the globe (alliance.js, from DRU_STAGE). */
.dru-alliance__readout {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
	color: var(--muted);
	font: var(--al-label);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.dru-alliance__readout b {
	color: var(--on-dark);
	font-weight: 500;
}

.dru-alliance__profile {
	display: grid;
	align-content: start;
	gap: 0.9rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--al-line);
}

/* The card's footer while faces swap: what the hover opens. */
.dru-alliance__strip {
	display: none;
}

.dru-alliance .dru-value__col .dru-value__terms {
	display: grid;
	gap: 0.55rem;
	margin: 0;
}

.dru-alliance .dru-value__col .dru-value__terms > li {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	margin: 0;
	color: var(--on-dark);
}

.dru-alliance .dru-value__col .dru-value__terms > li::before {
	content: "";
	flex: none;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--cyan);
	box-shadow: 0 0 8px var(--cyan);
	transform: translateY(-0.12em);
}

.dru-alliance .dru-value__col .dru-more {
	margin: 0.25rem 0 0;
}

.dru-alliance .dru-value__col .dru-more a {
	color: var(--gold);
}

@media (hover: hover) {
	/* Face and profile in one place: the card is as tall as the taller. */
	.dru-alliance .has-drawers .dru-alliance__swap > * {
		grid-area: 1 / 1;
		transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
	}

	.dru-alliance .has-drawers .dru-alliance__profile {
		padding-top: 0;
		border-top: 0;
		opacity: 0;
		transform: translate3d(0, 14px, 0);
		pointer-events: none;
	}

	.dru-alliance .has-drawers > .dru-value__col:is(:hover, :focus-within, .is-focus) .dru-alliance__face {
		opacity: 0;
		transform: translate3d(0, -12px, 0);
	}

	.dru-alliance .has-drawers > .dru-value__col:is(:hover, :focus-within, .is-focus) .dru-alliance__profile {
		opacity: 1;
		transform: none;
		pointer-events: auto;
		transition-delay: 0.08s;
	}

	.dru-alliance .has-drawers .dru-alliance__strip {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
		margin: auto calc(-1 * var(--al-pad)) calc(-1 * var(--al-pad));
		padding: 1.05rem var(--al-pad);
		border-top: 1px solid var(--al-line);
		background: linear-gradient(180deg, rgba(10, 18, 36, 0.35), rgba(6, 10, 20, 0.75));
		color: var(--cyan);
		font: var(--al-label);
		letter-spacing: 0.16em;
		text-transform: uppercase;
	}

	.dru-alliance .has-drawers .dru-alliance__strip::after {
		content: "+";
		color: var(--on-dark-muted);
		font-size: 1rem;
		line-height: 1;
		transition: transform 0.5s var(--ease);
	}

	.dru-alliance .has-drawers > .dru-value__col:is(:hover, :focus-within, .is-focus) .dru-alliance__strip::after {
		transform: rotate(45deg);
	}
}

/* ==========================================================================
   4. Value exchange
   Two rails whose rows pair up across a spine: subgrid rows, so a row
   and its pair always share a height. The spine and its links are
   alliance.js's; without them the rails still align.
   ========================================================================== */

.dru-alliance .dru-exchange__rails {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--al-spine) minmax(0, 1fr);
	grid-template-rows: auto repeat(8, auto);
	gap: 0;
}

.dru-alliance .dru-exchange__rail {
	grid-row: 1 / -1;
	display: grid;
	grid-template-rows: subgrid;
	gap: 0;
}

.dru-alliance .dru-exchange__rail:first-child {
	grid-column: 1;
}

.dru-alliance .dru-exchange__rail ~ .dru-exchange__rail {
	grid-column: 3;
}

.dru-alliance .dru-exchange__rail > .dru-ledger {
	grid-row: 2 / -1;
	display: grid;
	grid-template-rows: subgrid;
	gap: 0;
}

.dru-alliance .dru-exchange__title {
	display: grid;
	gap: 0.85rem;
	margin: 0 0 var(--al-gap);
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--al-line);
	color: #FFFFFF;
	font-size: clamp(1.375rem, 2vw, 1.75rem);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.dru-alliance .dru-exchange__title::before {
	content: "RAIL_A // PARTNER";
	content: "RAIL_A // PARTNER" / "";
	color: var(--gold);
	font: var(--al-label);
	letter-spacing: 0.18em;
}

.dru-alliance .dru-exchange__rail ~ .dru-exchange__rail .dru-exchange__title::before {
	content: "RAIL_B // ECOSYSTEM";
	content: "RAIL_B // ECOSYSTEM" / "";
	color: var(--cyan);
}

.dru-alliance .dru-exchange .dru-ledger > * {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0 0 var(--al-gap);
	padding: 1.5rem 1.625rem;
	transition: border-color 0.45s var(--ease), background-color 0.45s var(--ease), transform 0.6s var(--ease);
}

.dru-alliance .dru-exchange__rail:first-child .dru-ledger > * {
	--node: rgba(255, 208, 0, 0.8);
}

.dru-alliance .dru-exchange .dru-ledger__term {
	color: #FFFFFF;
	font-size: 1.125rem;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.dru-alliance .dru-exchange .dru-ledger__desc {
	color: var(--ink);
	line-height: 1.55;
}

.dru-alliance .dru-exchange .dru-ledger > .is-paired {
	border-color: rgba(0, 240, 255, 0.4);
	background-color: rgba(10, 18, 36, 0.72);
}

.dru-alliance .dru-exchange__rail:first-child .dru-ledger > .is-paired {
	border-color: rgba(255, 208, 0, 0.42);
	transform: translate3d(6px, 0, 0);
}

.dru-alliance .dru-exchange__rail ~ .dru-exchange__rail .dru-ledger > .is-paired {
	transform: translate3d(-6px, 0, 0);
}

/* The spine and a link per pair of rows. */
.dru-exchange__spine {
	grid-column: 2;
	grid-row: 2 / -1;
	justify-self: center;
	width: 1px;
	margin-bottom: var(--al-gap);
	background: linear-gradient(transparent, rgba(255, 255, 255, 0.16) 12%, rgba(255, 255, 255, 0.16) 88%, transparent);
	pointer-events: none;
}

.dru-exchange__hub {
	grid-column: 2;
	grid-row: 1;
	align-self: end;
	justify-self: center;
	width: 9px;
	height: 9px;
	margin-bottom: calc(var(--al-gap) - 4px);
	border: 1px solid var(--cyan);
	border-radius: 50%;
	box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
	pointer-events: none;
}

.dru-exchange__link {
	position: relative;
	grid-column: 2;
	align-self: center;
	height: 1px;
	margin-bottom: var(--al-gap);
	background: radial-gradient(circle, rgba(0, 240, 255, 0.55) 0 1px, transparent 1.2px) 0 50% / 6px 1px repeat-x;
	transform-origin: center;
	pointer-events: none;
}

/* Packets both ways while the pair is lit: gold from the partner's rail,
   cyan back from the ecosystem's. */
.dru-exchange__link::before,
.dru-exchange__link::after {
	content: "";
	position: absolute;
	top: -2.5px;
	left: 0;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	opacity: 0;
}

.dru-exchange__link::before {
	background: var(--gold);
	box-shadow: 0 0 10px var(--gold);
}

.dru-exchange__link::after {
	background: var(--cyan);
	box-shadow: 0 0 10px var(--cyan);
}

/* ==========================================================================
   5. Handshake
   The steps under a sequence of exchanges between the partner, the
   platform and the public (alliance.js reads who acts from each step).
   ========================================================================== */

.dru-alliance .dru-steps {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--al-gap);
	counter-reset: beat;
}

.dru-alliance .dru-steps > *,
.dru-alliance .dru-steps > *:nth-child(n) {
	grid-column: auto;
	display: flex;
	flex-direction: column;
	min-height: clamp(15rem, 30svh, 18rem);
	padding: var(--al-pad);
	counter-increment: beat;
	transition: border-color 0.6s var(--ease), background-color 0.6s var(--ease);
}

.dru-alliance .dru-steps > *::before {
	content: "BEAT_" counter(beat, decimal-leading-zero) " // " var(--beat, "STEP");
	content: "BEAT_" counter(beat, decimal-leading-zero) " // " var(--beat, "STEP") / "";
	margin-bottom: 1.75rem;
	padding-bottom: 0.875rem;
	background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), transparent 70%) left bottom / 100% 1px no-repeat;
	color: var(--on-dark-muted);
	font: var(--al-label);
	letter-spacing: 0.16em;
	transition: color 0.6s var(--ease);
}

.dru-alliance .dru-steps > .is-lit {
	border-color: rgba(0, 240, 255, 0.3);
}

.dru-alliance .dru-steps > .is-lit::before {
	color: var(--cyan);
}

.dru-alliance .dru-steps__line {
	color: #FFFFFF;
	font-size: clamp(1.5rem, 2.2vw, 2rem);
	font-weight: 300;
	line-height: 1.12;
	letter-spacing: -0.03em;
}

.dru-alliance .dru-steps > *:last-child .dru-steps__line {
	color: #FFFFFF;
}

.dru-alliance .dru-steps__note {
	max-width: none;
	margin-top: auto;
	padding-top: 1.25rem;
	color: var(--ink);
	font-size: 1rem;
	line-height: 1.55;
}

/* The sequence: three lanes, one exchange over each step. */
.dru-handshake {
	grid-column: 1 / -1;
	position: relative;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-template-rows: repeat(3, 2.75rem);
	column-gap: var(--al-gap);
	margin-bottom: var(--al-gap);
	pointer-events: none;
}

.dru-handshake__lane {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 0.875rem;
	color: var(--muted);
	font: var(--al-label);
	letter-spacing: 0.18em;
}

.dru-handshake__lane::after {
	content: "";
	flex: 1 1 auto;
	height: 2px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0 1px, transparent 1.2px) 0 50% / 8px 2px repeat-x;
}

.dru-handshake__lane:nth-child(1) { grid-row: 1; color: var(--gold); }
.dru-handshake__lane:nth-child(2) { grid-row: 2; color: var(--cyan); }
.dru-handshake__lane:nth-child(3) { grid-row: 3; }

/* An exchange: a line from one lane to the next, arrowheads where it
   arrives, its code beside it. */
.dru-handshake__beat {
	position: relative;
	justify-self: center;
	align-self: stretch;
	width: 1px;
	margin-block: 1.375rem;
	background: linear-gradient(var(--gold), var(--cyan));
	transform-origin: 50% 0;
}

.dru-handshake__beat::after,
.dru-handshake__beat.is-both::before {
	content: "";
	position: absolute;
	left: -4px;
	width: 0;
	height: 0;
	border-inline: 4.5px solid transparent;
}

.dru-handshake__beat::after {
	bottom: -1px;
	border-top: 7px solid var(--cyan);
}

.dru-handshake__beat.is-both::before {
	top: -1px;
	border-bottom: 7px solid var(--gold);
}

.dru-handshake__code {
	position: absolute;
	top: 50%;
	left: 0.875rem;
	padding: 0.3rem 0.6rem;
	border: 1px solid rgba(0, 240, 255, 0.3);
	border-radius: 999px;
	background: rgba(6, 10, 20, 0.85);
	color: #FFFFFF;
	font: var(--al-label);
	letter-spacing: 0.14em;
	white-space: nowrap;
	transform: translate3d(0, -50%, 0);
}

/* ==========================================================================
   6. Protocol terminal
   ========================================================================== */

.dru-alliance .dru-join__form {
	position: relative;
	padding: clamp(1.75rem, 3.2vw, 3.25rem);
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 28px;
	background-color: var(--al-glass-strong);
	-webkit-backdrop-filter: var(--al-blur);
	backdrop-filter: var(--al-blur);
	box-shadow:
		0 70px 140px -70px rgba(0, 240, 255, 0.28),
		0 40px 90px -50px rgba(0, 0, 0, 0.9),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Its rim: a hairline that turns from cyan through gold. */
.dru-alliance .dru-join__form::before {
	content: "";
	position: absolute;
	inset: -1px;
	padding: 1px;
	border-radius: inherit;
	background: linear-gradient(125deg, rgba(0, 240, 255, 0.65), rgba(255, 255, 255, 0.06) 32%, rgba(255, 255, 255, 0.04) 62%, rgba(255, 208, 0, 0.45));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	pointer-events: none;
}

.dru-alliance .dru-join__aside {
	gap: 1rem;
}

.dru-alliance .dru-join__aside h2 {
	color: #FFFFFF;
	font-size: clamp(1.875rem, 3vw, 2.75rem);
	font-weight: 300;
	line-height: 1.05;
	letter-spacing: -0.04em;
}

.dru-alliance .dru-join__aside p {
	color: var(--ink);
}

/* Who answers: the copy says the team replies in person. */
.dru-alliance .dru-join__aside::after {
	content: "RESPONSE // PERSONAL";
	content: "RESPONSE // PERSONAL" / "";
	display: inline-flex;
	align-self: flex-start;
	margin-top: 0.5rem;
	padding: 0.45rem 0.8rem;
	border: 1px solid rgba(61, 220, 151, 0.35);
	border-radius: 999px;
	color: var(--success);
	font: var(--al-label);
	letter-spacing: 0.14em;
}

/* A memo, when one is added in the editor (a File block in the aside). */
.dru-alliance .dru-join__aside .wp-block-file {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 0.5rem 0 0;
	padding: 0.875rem 1rem;
	border: 1px solid var(--al-line);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.03);
}

.dru-alliance .dru-join__aside .wp-block-file::before {
	content: "MEMO";
	content: "MEMO" / "";
	color: var(--gold);
	font: var(--al-label);
	letter-spacing: 0.16em;
}

/* One surface: the form inside the terminal is flat. */
.dru-alliance .dru-join__panel .dru-form {
	padding: 0;
	border: 0;
	background: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	box-shadow: none;
}

/* ==========================================================================
   7. Entrances
   The gateway from first paint, without JS: the bar comes up, the title
   gathers from a scatter letter by letter, the standfirst and the action
   follow, then the monitor. A page that arrived by a page transition
   holds all of it until the router's entrance starts, and plays it then
   (alliance.js adds .is-arriving). The rest is alliance.js's.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
	.dru-alliance__bar {
		animation: al-fade 0.8s var(--ease) 0.1s backwards;
	}

	.dru-alliance__rule {
		animation: al-draw 1.6s var(--ease) 0.3s backwards;
	}

	.dru-alliance__char {
		animation: al-gather 1.5s cubic-bezier(0.16, 1, 0.3, 1) calc(0.25s + var(--o, 0) * 0.75s) backwards;
	}

	.dru-alliance .dru-trust .dru-trust__standfirst,
	.dru-page[data-dru-entered] .dru-alliance.is-arriving .dru-trust .dru-trust__standfirst {
		animation: al-rise 1s var(--ease) 1.05s backwards;
	}

	.dru-alliance .dru-trust .dru-trust__actions {
		animation: al-rise 1s var(--ease) 1.2s backwards;
	}

	.dru-alliance__monitor {
		animation: al-rise 1s var(--ease) 1.35s backwards;
	}

	.dru-page[data-dru-entered] .dru-alliance:not(.is-arriving) :is(.dru-alliance__bar, .dru-alliance__rule, .dru-alliance__char, .dru-trust__actions, .dru-alliance__monitor) {
		animation: none;
	}

	/* A new line in the monitor. */
	.dru-alliance__log > li.is-new {
		animation: al-log 0.6s var(--ease);
	}

	/* The insignia's packets while its card is lit. */
	.dru-value__col:is(:hover, :focus-within, .is-focus) .dru-alliance__sigil .is-packet {
		animation: al-packet 1.7s cubic-bezier(0.45, 0, 0.55, 1) infinite;
	}

	.dru-value__col:is(:hover, :focus-within, .is-focus) .dru-alliance__sigil .is-packet:nth-of-type(2n) {
		animation-delay: -0.85s;
	}

	/* A lit pair: packets cross the link both ways. */
	.dru-exchange__link.is-paired::before {
		animation: al-cross 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
	}

	.dru-exchange__link.is-paired::after {
		animation: al-cross-back 1.6s cubic-bezier(0.45, 0, 0.55, 1) 0.8s infinite;
	}
}

@keyframes al-fade {
	from { opacity: 0; }
}

@keyframes al-draw {
	from { transform: scaleX(0); }
}

@keyframes al-rise {
	from { opacity: 0; transform: translate3d(0, 18px, 0); }
}

@keyframes al-gather {
	from {
		opacity: 0;
		filter: blur(8px);
		transform: translate3d(calc(var(--dx, 0) * 1em), calc(var(--dy, 0) * 1em), 0) rotate(calc(var(--dr, 0) * 1deg)) scale(0.35);
	}
	55% {
		opacity: 1;
		filter: blur(0);
	}
}

@keyframes al-log {
	from { opacity: 0; }
}

@keyframes al-packet {
	0% { opacity: 0; transform: translate(0, 0); }
	15%, 80% { opacity: 1; }
	100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)); }
}

@keyframes al-cross {
	0% { opacity: 0; transform: translate3d(0, 0, 0); }
	15%, 85% { opacity: 1; }
	100% { opacity: 0; transform: translate3d(calc(var(--al-spine) - 6px), 0, 0); }
}

@keyframes al-cross-back {
	0% { opacity: 0; transform: translate3d(calc(var(--al-spine) - 6px), 0, 0); }
	15%, 85% { opacity: 1; }
	100% { opacity: 0; transform: translate3d(0, 0, 0); }
}

/* ==========================================================================
   8. Responsive
   ========================================================================== */

@media (max-width: 1199px) {
	.dru-alliance__seg {
		padding-inline: 0.75rem;
		font-size: 0.875rem;
	}

	.dru-alliance.dru-main .dru-alliance__monitor {
		width: min(19rem, 36vw);
	}
}

@media (max-width: 959px) {
	.dru-alliance {
		/* Phones and small tablets: opaque-enough glass instead of live blur. */
		--al-blur: none;
		--al-glass: rgba(9, 13, 26, 0.9);
		--al-glass-strong: rgba(9, 13, 26, 0.96);
		--al-spine: 0px;
	}

	.dru-alliance__tag:nth-child(3) {
		display: none;
	}

	.dru-alliance .dru-trust {
		justify-content: flex-end;
		padding-block: 4.5rem 2rem;
	}

	.dru-alliance .dru-trust h1,
	.dru-alliance .dru-trust .dru-trust__standfirst {
		grid-column: 1 / -1;
	}

	/* The monitor at the foot of the gateway, full width, in room kept for
	   it from first paint: alliance.js builds it as the page mounts, and
	   it must move nothing (html.dru-js is set in the head). Its height is
	   its padding, head and four log rows (1.3em each at 11px). */
	.dru-alliance .dru-trust {
		--al-monitor-h: 9.375rem;
	}

	.dru-js .dru-alliance .dru-trust {
		padding-bottom: calc(2rem + var(--al-monitor-h) + 2rem);
	}

	.dru-alliance.dru-main .dru-alliance__monitor {
		right: calc((100% - var(--al-frame)) / 2);
		bottom: 2rem;
		width: var(--al-frame);
		height: var(--al-monitor-h);
	}

	/* The filter as a small matrix: all of them across the top, then the
	   formats two by two, every choice in sight. */
	.dru-alliance__filter {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.25rem;
		border-radius: 22px;
	}

	.dru-alliance__seg {
		justify-content: flex-start;
		border-radius: 16px;
	}

	.dru-alliance__seg:first-of-type {
		grid-column: 1 / -1;
		justify-content: center;
	}

	.dru-alliance__beam {
		border-radius: 16px;
	}

	.dru-alliance .dru-value .dru-value__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dru-alliance .dru-value__col,
	.dru-alliance .dru-value__col:nth-child(n) {
		grid-column: 1 / -1;
		min-height: 0;
	}

	/* Rails one after the other; no spine. */
	.dru-alliance .dru-exchange__rails {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		row-gap: calc(var(--al-gap) * 2);
	}

	.dru-alliance .dru-exchange__rail,
	.dru-alliance .dru-exchange__rail > .dru-ledger {
		grid-row: auto;
		grid-template-rows: none;
	}

	.dru-alliance .dru-exchange__rail:first-child,
	.dru-alliance .dru-exchange__rail ~ .dru-exchange__rail {
		grid-column: 1;
	}

	.dru-exchange__spine,
	.dru-exchange__hub,
	.dru-exchange__link {
		display: none;
	}

	.dru-alliance .dru-exchange .dru-ledger > .is-paired,
	.dru-alliance .dru-exchange .dru-exchange__rail ~ .dru-exchange__rail .dru-ledger > .is-paired {
		transform: none;
	}

	/* The last exchange's code to the left of its line, inside the frame. */
	.dru-handshake__beat:last-child .dru-handshake__code {
		left: auto;
		right: 0.875rem;
	}

	.dru-alliance .dru-steps {
		grid-template-columns: minmax(0, 1fr);
	}

	.dru-alliance .dru-steps > *,
	.dru-alliance .dru-steps > *:nth-child(n) {
		min-height: 0;
		padding-left: var(--al-pad);
	}

	.dru-alliance .dru-join__aside,
	.dru-alliance .dru-join__panel {
		grid-column: 1 / -1;
	}
}

@media (max-width: 639px) {
	.dru-alliance__count {
		display: none;
	}

	.dru-handshake {
		grid-template-rows: repeat(3, 2.25rem);
	}

	.dru-handshake__lane {
		font-size: 0.5625rem;
	}

	.dru-handshake__beat {
		margin-block: 1.125rem;
	}

	.dru-handshake__code {
		left: 0.5rem;
		padding: 0.2rem 0.45rem;
		font-size: 0.5625rem;
	}

	/* The narrowest phones: the monitor's rows take the room its sides had. */
	.dru-alliance.dru-main .dru-alliance__monitor {
		padding-inline: 1rem;
	}
}
