@charset "utf-8";

/* =========================================================================
   Research project sub-pages. Builds on glass.css (tokens, glass, tiles).
   ========================================================================= */

/* ---------- Project hero ---------- */
.phero {
	max-width: calc(var(--page) + 48px);
	margin: 0 auto;
	min-height: 72vh;
	min-height: 72svh;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 18px;
	padding: 120px 24px 40px;
}

.phero .back {
	align-self: flex-start;
	margin-bottom: 18px;
	font-size: 14px;
	padding: 10px 18px;
}

.phero h1 {
	font-size: clamp(44px, 7.4vw, 104px);
	line-height: 0.98;
	letter-spacing: -0.04em;
	max-width: 14ch;
}

.phero__sub {
	max-width: 760px;
	font-size: clamp(19px, 2vw, 26px);
	font-weight: 500;
	line-height: 1.3;
}

.phero__hook {
	max-width: 720px;
	font-size: clamp(17px, 1.5vw, 20px);
	color: var(--ink-2);
}

.phero__authors {
	font-size: 14.5px;
	color: var(--ink-2);
}

.phero__authors b {
	color: var(--ink);
}

.phero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}

.phero__actions .pill {
	font-size: 15px;
	padding: 11px 20px;
}

.section--first {
	padding-top: 24px;
}

/* ---------- Explainer: step-driven animated figure ---------- */
.explainer {
	margin: 0;
	gap: 20px;
}

.explainer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.explainer__head .eyebrow {
	margin: 0;
}

.explainer__title {
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 500;
	letter-spacing: -0.02em;
}

.explainer__controls {
	display: flex;
	gap: 8px;
}

.explainer__controls button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--ink);
	cursor: pointer;
}

.explainer__controls svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.explainer .icon-play,
.explainer.is-paused .icon-pause {
	display: none;
}

.explainer.is-paused .icon-play {
	display: block;
}

.explainer__stage {
	position: relative;
	border-radius: var(--radius-inner);
	background: rgba(255, 255, 255, 0.38);
	box-shadow: inset 0 0 0 1px rgba(11, 11, 16, 0.05);
	overflow: hidden;
}

.explainer__stage svg {
	display: block;
	width: 100%;
	height: auto;
	font-family: "Euclid Circular B", system-ui, sans-serif;
}

.explainer.is-paused .explainer__stage *,
.explainer.is-offscreen .explainer__stage * {
	animation-play-state: paused !important;
}

.explainer__steps {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
	gap: 10px;
}

.explainer__steps button {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	height: 100%;
	padding: 14px 14px 16px;
	border: 0;
	border-radius: 16px;
	text-align: left;
	font: inherit;
	font-size: 14px;
	line-height: 1.45;
	color: var(--ink-2);
	background: rgba(255, 255, 255, 0.28);
	box-shadow: inset 0 0 0 1px rgba(11, 11, 16, 0.05);
	cursor: pointer;
	overflow: hidden;
	transition: background 0.4s, color 0.4s, box-shadow 0.4s;
}

/* a link that belongs to a step sits inside its card, below the text */
.explainer__steps li {
	position: relative;
}

.explainer__steps li:has(.explainer__link) button {
	padding-bottom: 44px;
}

.explainer__link {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--ink);
	background: linear-gradient(var(--hairline), var(--hairline)) 0 100% / 100% 1.5px no-repeat;
	transition: background 0.3s;
}

.explainer__link:hover {
	background-image: var(--grad);
}

.explainer__steps .explainer__link {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 16px;
	z-index: 1;
	width: max-content;
	max-width: calc(100% - 28px);
}

.explainer__caption .explainer__link {
	align-self: flex-start;
	margin-top: 4px;
}

.explainer__steps button:hover {
	background: rgba(255, 255, 255, 0.5);
}

.explainer__steps span {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.12em;
	color: var(--ink-3);
}

.explainer__steps b {
	font-size: 15px;
	font-weight: 500;
	color: var(--ink);
}

.explainer__steps li.on button {
	color: var(--ink);
	background: rgba(255, 255, 255, 0.78);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.9),
		0 10px 24px -14px rgba(24, 20, 48, 0.4);
}

.explainer__steps li.on span {
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* progress bar along the bottom of the active step */
.explainer__steps button::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	background: var(--grad);
	transform: scaleX(0);
	transform-origin: left;
}

.explainer__steps li.on button::after {
	animation: step-progress var(--dur, 3s) linear forwards;
}

.explainer.is-paused .explainer__steps li.on button::after,
.explainer.is-offscreen .explainer__steps li.on button::after {
	animation-play-state: paused;
}

.explainer__steps li.done button::after {
	transform: scaleX(1);
	opacity: 0.25;
}

@keyframes step-progress {
	to {
		transform: scaleX(1);
	}
}

/* ---------- Shared SVG vocabulary ---------- */
.ex-node {
	fill: rgba(255, 255, 255, 0.82);
	stroke: rgba(11, 11, 16, 0.12);
	stroke-width: 1.2;
}

.ex-node--dark {
	fill: rgba(16, 14, 22, 0.88);
	stroke: none;
}

.ex-node--bad {
	fill: rgba(255, 238, 236, 0.92);
	stroke: rgba(224, 38, 27, 0.45);
}

.ex-zone {
	fill: rgba(255, 255, 255, 0.25);
	stroke: rgba(11, 11, 16, 0.18);
	stroke-width: 1.2;
	stroke-dasharray: 6 6;
}

.ex-label {
	font-size: 16px;
	font-weight: 500;
	fill: var(--ink);
	text-anchor: middle;
}

.ex-label--light {
	fill: #fff;
}

.ex-small {
	font-size: 14px;
	fill: var(--ink-2);
	text-anchor: middle;
}

.ex-tag {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	fill: var(--ink-3);
	text-anchor: middle;
}

.ex-wire {
	fill: none;
	stroke: rgba(11, 11, 16, 0.22);
	stroke-width: 2;
}

.ex-wire--ctrl {
	stroke-dasharray: 5 7;
}

/* lines that draw themselves in */
.ex-draw {
	fill: none;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	transition: stroke-dashoffset 1s var(--ease-out);
}

/* things that fade in on their step */
.ex-in {
	opacity: 0;
	transition: opacity 0.6s var(--ease-out);
}

.ex-in--late {
	transition-delay: 0.7s;
}

.ex-in--later {
	transition-delay: 1.4s;
}

.ex-pop {
	transform-box: fill-box;
	transform-origin: center;
	transform: scale(0.6);
	opacity: 0;
	transition: transform 0.6s var(--ease-spring), opacity 0.4s;
}

.ex-glow {
	transition: filter 0.5s, stroke 0.5s;
}

/* ---------- Content blocks ---------- */
.prose {
	max-width: 760px;
}

.prose p {
	color: var(--ink-2);
}

.prose p+p {
	margin-top: 14px;
}

.tile h3 {
	font-size: 22px;
}

.tile ul.ticks {
	list-style: none;
	display: grid;
	gap: 10px;
	font-size: 16px;
	color: var(--ink-2);
}

.tile ul.ticks li {
	position: relative;
	padding-left: 26px;
}

.tile ul.ticks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--grad);
}

.tile ul.ticks--warn li::before {
	background: none;
	border: 1.5px solid var(--ink-3);
}

.tile ul.ticks b {
	color: var(--ink);
	font-weight: 500;
}

.quote {
	font-size: clamp(20px, 2.2vw, 28px);
	font-weight: 300;
	line-height: 1.3;
	letter-spacing: -0.015em;
}

.tile p.quote {
	color: var(--ink);
}

.stat-tile strong {
	display: block;
	font-size: clamp(40px, 4.6vw, 64px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.04em;
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.stat-tile p {
	font-size: 15.5px;
}

.stat-tile p b {
	color: var(--ink);
	font-weight: 500;
}

/* ---------- Comparison matrix ---------- */
.matrix {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 6px;
	font-size: 14.5px;
}

.matrix th {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--ink-3);
	text-align: center;
	padding: 0 4px 4px;
}

.matrix th:first-child {
	text-align: left;
}

.matrix td {
	padding: 10px 6px;
	text-align: center;
	background: rgba(255, 255, 255, 0.4);
}

.matrix td:first-child {
	text-align: left;
	padding-left: 14px;
	border-radius: 12px 0 0 12px;
	color: var(--ink);
}

.matrix td:last-child {
	border-radius: 0 12px 12px 0;
}

.matrix tr.us td {
	background: rgba(255, 255, 255, 0.85);
	font-weight: 500;
}

.mk {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	font-size: 12px;
	font-weight: 600;
}

.mk--yes {
	color: #fff;
	background: var(--grad);
}

.mk--part {
	color: var(--ink-2);
	box-shadow: inset 0 0 0 1.5px var(--ink-3);
}

.mk--no {
	color: var(--red);
	box-shadow: inset 0 0 0 1.5px rgba(224, 38, 27, 0.5);
}

.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 13px;
	color: var(--ink-2);
}

.legend span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.legend .mk {
	width: 18px;
	height: 18px;
	font-size: 10px;
}

/* ---------- Citation ---------- */
.cite {
	position: relative;
}

.cite pre {
	margin: 0;
	padding: 20px 22px;
	border-radius: var(--radius-inner);
	background: rgba(14, 12, 20, 0.88);
	color: rgba(255, 255, 255, 0.86);
	font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	overflow-x: auto;
	white-space: pre;
}

/* sits in the tile's top-right corner, level with the "Cite" eyebrow */
.cite__copy {
	position: absolute;
	top: clamp(18px, 2.6vw, 30px);
	right: clamp(24px, 3vw, 36px);
	z-index: 3;
	padding: 7px 16px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--ink);
	background: rgba(255, 255, 255, 0.72);
	box-shadow:
		inset 0 0 0 1px rgba(11, 11, 16, 0.08),
		0 6px 16px -10px rgba(24, 20, 48, 0.4);
	cursor: pointer;
	transition: background 0.3s, transform 0.45s var(--ease-spring);
}

.cite__copy:hover {
	background: #fff;
	transform: translateY(-1px);
}

/* ---------- More research ---------- */
.more {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--gap);
}

.more a.tile {
	gap: 8px;
}

.more .badge {
	align-self: flex-start;
}

.more a.tile p {
	font-size: 15px;
}

.more .tile__title {
	font-size: 21px;
}

.more .link {
	margin-top: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
	.more {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.more {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 760px) {

	/* steps collapse to the active caption plus a row of dots */
	.explainer__steps {
		grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
		gap: 6px;
	}

	.explainer__steps button {
		padding: 0;
		height: 6px;
		border-radius: 999px;
		background: rgba(11, 11, 16, 0.1);
		box-shadow: none;
		/* the step text is a bare text node, so hide it by size, not display */
		font-size: 0;
		line-height: 0;
		color: transparent;
	}

	.explainer__steps button > * {
		display: none;
	}

	.explainer__steps button::after {
		height: 100%;
	}

	.explainer__steps li.on button {
		background: rgba(11, 11, 16, 0.1);
		box-shadow: none;
	}

	.explainer__caption {
		display: flex !important;
	}

	.explainer__steps .explainer__link {
		display: none;
	}

	.explainer__steps li:has(.explainer__link) button {
		padding-bottom: 0;
	}

	/* the diagram keeps a readable size and pans; explainer.js follows each
	   step's data-focus (an x coordinate in viewBox units) */
	.explainer__stage {
		margin: 0 calc(-1 * clamp(24px, 3vw, 36px));
		border-radius: 0;
		box-shadow: none;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
		mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
	}

	.explainer__stage::-webkit-scrollbar {
		display: none;
	}

	.explainer__stage svg {
		min-width: 700px;
	}

	.explainer__head {
		flex-wrap: wrap;
	}

	.matrix {
		font-size: 13px;
	}

	.matrix td,
	.matrix th {
		padding-left: 2px;
		padding-right: 2px;
	}
}

.explainer__caption {
	display: none;
	flex-direction: column;
	gap: 4px;
	min-height: 7.5em;
	font-size: 15px;
	color: var(--ink-2);
}

.explainer__caption b {
	font-size: 16px;
	font-weight: 500;
	color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {

	.ex-draw,
	.ex-in,
	.ex-pop {
		transition: none;
	}
}
