@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../assets/jetbrains-mono-latin.woff2") format("woff2");
}

.portfolio-page {
	color-scheme: dark;
}

body.portfolio-page {
	--portfolio-background: #000;
	--portfolio-text: var(--background);
	--portfolio-muted: color-mix(in srgb, var(--portfolio-text) 68%, transparent);
	width: 100%;
	height: 100vh;
	height: 100dvh;
	min-height: 580px;
	overflow: hidden;
	background: var(--portfolio-background);
	color: var(--portfolio-text);
	font-size: 1rem;
}

body.portfolio-page.light-mode {
	color-scheme: light;
	--portfolio-background: var(--background);
	--portfolio-text: var(--text);
	--portfolio-muted: color-mix(in srgb, var(--portfolio-text) 68%, transparent);
}

.portfolio-page p {
	color: var(--portfolio-text);
}

.portfolio-page a:hover {
	color: var(--accent);
}

.portfolio-header {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 1.5rem;
	min-height: 4.5rem;
	padding: 0 var(--page-gutter);
}

.portfolio-back {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	width: fit-content;
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--portfolio-text);
	background-image: linear-gradient(var(--accent), var(--accent));
	background-position: left center;
	background-repeat: no-repeat;
	background-size: 0 100%;
	color: var(--portfolio-text);
	font-family: "JetBrains Mono", monospace;
	font-size: 0.68rem;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 180ms ease, background-size 220ms ease;
	white-space: nowrap;
}

.portfolio-page .portfolio-back:hover,
.portfolio-page .portfolio-back:focus-visible {
	background-size: 100% 100%;
	color: var(--portfolio-background);
}

.portfolio-page .portfolio-back:focus-visible {
	outline: 2px solid var(--portfolio-text);
	outline-offset: 3px;
}

.portfolio-header nav {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 0.5rem;
}

.theme-toggle {
	position: fixed;
	right: calc(var(--page-gutter) + 0.8rem);
	bottom: 2.27rem;
	z-index: 5;
	display: grid;
	width: 1.6rem;
	height: 1.6rem;
	padding: 0;
	place-items: center;
	border: 0;
	background: transparent;
	color: var(--portfolio-text);
	cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
	color: var(--accent);
}

.theme-toggle:focus-visible {
	outline: 1px solid var(--accent);
	outline-offset: 3px;
}

.theme-icon {
	width: 1.25rem;
	height: 1.25rem;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.6;
}

.view-button {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.45rem;
	border: 1px solid color-mix(in srgb, var(--portfolio-text) 24%, transparent);
	border-radius: 0;
	background: transparent;
	color: var(--portfolio-muted);
	font: inherit;
	font-size: 0.72rem;
	cursor: pointer;
}

.view-toggles {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.connection-toggles {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-left: 0.35rem;
}

.connection-toggles[hidden] {
	display: none;
}

.view-toggle-label,
.connection-toggle-label {
	margin-right: 0.2rem;
	color: var(--portfolio-muted);
	font-size: 0.72rem;
	white-space: nowrap;
}

.connection-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.45rem;
	border: 1px solid color-mix(in srgb, var(--portfolio-text) 24%, transparent);
	background: transparent;
	color: var(--portfolio-muted);
	font: inherit;
	font-size: 0.72rem;
	cursor: pointer;
}

.connection-toggle[hidden] {
	display: none;
}

.connection-toggle[aria-pressed="true"] {
	color: var(--portfolio-text);
}

.connection-toggle[aria-pressed="false"] {
	opacity: 0.55;
}

.connection-toggle .legend-line {
	border-top-color: currentColor;
}

.connection-toggle .legend-line--type {
	border-top-color: var(--accent-coral);
}

.connection-toggle .legend-line--client {
	border-top-color: var(--accent-teal);
}

.connection-toggle .legend-line--topic {
	border-top-color: var(--accent-lilac);
}

.view-button[aria-pressed="true"],
.view-button:hover {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--background);
}

.view-button .legend-line {
	border-top-color: currentColor;
}



.constellation-main {
	display: grid;
	grid-template-rows: minmax(0, 1fr);
	width: 100%;
	height: calc(100% - 4.5rem);
	padding: 0.45rem var(--page-gutter) 0.8rem;
}

.constellation-shell {
	position: relative;
	isolation: isolate;
	min-height: 0;
	overflow: hidden;
}

.connections,
.timeline-axis,
.topic-treemap,
.constellation {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.connections {
	z-index: -1;
	overflow: visible;
}

.timeline-axis {
	z-index: -1;
	display: none;
	overflow: visible;
	pointer-events: none;
}

.topic-treemap {
	z-index: 1;
	display: none;
	overflow: hidden;
}

.timeline-mode .connections {
	display: none;
}

.timeline-mode .timeline-axis {
	display: block;
}

.topic-mode .connections,
.topic-mode .timeline-axis {
	display: none;
}

.topic-mode .topic-treemap {
	display: block;
}

.topic-mode .topic-treemap,
.topic-mode .treemap-project-stars {
	bottom: 4.5rem;
	height: calc(100% - 4.5rem);
}

.topic-mode .constellation > .star {
	visibility: hidden;
	pointer-events: none;
}

.treemap-project-stars {
	position: absolute;
	z-index: 1;
	inset: 0;
	display: none;
	pointer-events: none;
}

.topic-mode .treemap-project-stars {
	display: block;
}

.treemap-star {
	pointer-events: auto;
}

.timeline-axis-line,
.timeline-axis-tick,
.timeline-axis-arrow,
.timeline-stem {
	fill: none;
	stroke: var(--portfolio-text);
	vector-effect: non-scaling-stroke;
}

.timeline-axis-line {
	stroke-width: 1;
	opacity: 0.45;
}

.timeline-axis-arrow {
	stroke-width: 1;
	opacity: 0.45;
}

.timeline-axis-tick {
	stroke-width: 1;
	opacity: 0.35;
}

.timeline-stem {
	stroke-width: 1;
	opacity: 1;
}

.timeline-year-guide {
	stroke: var(--accent);
	stroke-width: 1;
	stroke-dasharray: 4 5;
	opacity: 0.7;
	vector-effect: non-scaling-stroke;
}

.cluster-label,
.topic-group-label,
.timeline-year-label {
	font-family: "JetBrains Mono", monospace;
}

.timeline-year-label {
	fill: var(--accent);
	font-size: 15px;
	letter-spacing: 0.04em;
	text-anchor: middle;
}

.treemap-topic-frame {
	fill: color-mix(in srgb, var(--accent) 5%, var(--portfolio-background));
	stroke: color-mix(in srgb, var(--accent) 60%, transparent);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.topic-group-label {
	position: absolute;
	z-index: 1;
	transform: translateY(-50%);
	color: var(--accent);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
}

.connection {
	fill: none;
	stroke: var(--portfolio-text);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
	opacity: 0.42;
	pointer-events: none;
	transition: opacity 500ms ease, stroke 500ms ease;
}

.connection--main {
	stroke-width: 1;
}

.connection--main.connection--hidden-on-hover {
	opacity: 0;
}

.connection:not(.connection--main) {
	opacity: 0.5;
}

.connection:not(.connection--main).connection--dimmed {
	opacity: 0.1;
}

.connection:not(.connection--main).connection--highlighted {
	opacity: 1;
}

.connection--type {
	stroke: var(--accent-coral);
	stroke-dasharray: 6 5;
}

.connection--client {
	stroke: var(--accent-teal);
	stroke-dasharray: 1 4;
	stroke-linecap: round;
}

.connection--topic {
	stroke: var(--accent-lilac);
}

.cluster-label {
	position: absolute;
	z-index: 0;
	transform: translate(-50%, -100%);
	color: var(--portfolio-text);
	font-size: 0.75rem;
	font-weight: 400;
	letter-spacing: 0.04em;
	line-height: 1;
	text-align: center;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
}

.star {
	position: absolute;
	z-index: 1;
	display: grid;
	width: 40px;
	height: 40px;
	padding: 4px;
	transform: translate(-50%, -50%);
	place-items: center;
	border: 1px solid color-mix(in srgb, var(--portfolio-text) 48%, transparent);
	background: var(--portfolio-background);
	cursor: pointer;
	transition: left 1100ms cubic-bezier(0.2, 0.7, 0.2, 1), top 1100ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 150ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.star:hover,
.star:focus-visible {
	z-index: 3;
	border-color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
	.star:hover,
	.star:focus-visible {
		transform: translate(-50%, -50%) rotate(4deg) scale(1.12);
		box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
	}
}

.project-stats {
	position: absolute;
	z-index: 2;
	bottom: 0.8rem;
	left: 0.8rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.6rem;
	background: color-mix(in srgb, var(--portfolio-background) 90%, transparent);
	color: var(--portfolio-text);
	font-size: 0.68rem;
	font-variant: small-caps;
	letter-spacing: 0.04em;
	line-height: 1.35;
	white-space: nowrap;
	pointer-events: none;
}

.project-stats-icon {
	width: 1.3rem;
	height: 1.3rem;
	filter: brightness(0) invert(1);
}

.light-mode .project-stats-icon {
	filter: brightness(0);
}

.project-stats p {
	margin: 0;
	color: var(--portfolio-text);
}

.project-stats-count {
	color: var(--accent);
}

.star img {
	position: absolute;
	inset: 4px;
	display: block;
	width: calc(100% - 8px);
	height: calc(100% - 8px);
	max-width: none;
	aspect-ratio: 1;
	object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
	.star,
	.connection {
		transition: none;
	}
}

.star-tooltip {
	position: absolute;
	z-index: 4;
	width: max-content;
	max-width: min(20rem, 42vw);
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--accent);
	background: var(--portfolio-background);
	color: var(--portfolio-text);
	font-size: 0.78rem;
	line-height: 1.4;
	pointer-events: none;
}

.star-tooltip strong,
.star-tooltip span {
	display: block;
}

.star-tooltip span {
	color: var(--portfolio-muted);
}

.legend-line {
	display: inline-block;
	width: 1rem;
	border-top: 1px solid var(--accent);
}

.legend-line--type {
	border-top-style: dashed;
}

.legend-line--client {
	border-top-style: dotted;
}

.project-dialog {
	position: fixed;
	inset: 50% auto auto 50%;
	width: min(42rem, calc(100vw - 2rem));
	max-width: none;
	max-height: min(88vh, 52rem);
	padding: 0;
	transform: translate(-50%, -50%);
	overflow: auto;
	border: 1px solid var(--accent);
	background: var(--portfolio-background);
	color: var(--portfolio-text);
}

.project-dialog::backdrop {
	background: rgb(10 5 24 / 78%);
	backdrop-filter: blur(3px);
}

.dialog-close {
	position: sticky;
	z-index: 1;
	top: 0.5rem;
	float: right;
	width: 2.2rem;
	height: 2.2rem;
	margin: 0.5rem 0.5rem -2.7rem 0;
	border: 1px solid var(--accent);
	background: var(--portfolio-background);
	color: var(--portfolio-text);
	font: inherit;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.dialog-content {
	padding: 1.25rem clamp(1.25rem, 5vw, 2.5rem) 2rem;
}

.dialog-image {
	display: block;
	width: 100%;
	height: 16rem;
	margin: 0 0 1.25rem;
	object-fit: cover;
	object-position: center;
}

.dialog-content h2 {
	max-width: 34rem;
	margin: 0 2.5rem 0.4rem 0;
	font-size: 2.2rem;
	font-weight: 400;
	line-height: 1.1;
}

.dialog-description {
	max-width: 38rem;
	margin: 1rem 0;
	font-size: 1rem;
}

.dialog-meta {
	display: grid;
	grid-template-columns: minmax(6rem, 0.6fr) 2fr;
	gap: 0.35rem 1rem;
	margin: 1rem 0;
	font-size: 0.9rem;
}

.dialog-meta dt {
	color: var(--portfolio-muted);
}

.dialog-meta dd {
	margin: 0;
}

.dialog-project-link {
	display: inline-block;
	margin-top: 0.6rem;
}

.portfolio-page.pdf-page {
	height: auto;
	min-height: 100vh;
	overflow-x: hidden;
	overflow-y: auto;
}

.pdf-header {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 2rem;
	padding: 3rem var(--page-gutter) 2rem;
}

.pdf-header .eyebrow,
.project-card .eyebrow {
	margin: 0 0 0.4rem;
	color: var(--accent);
	font-family: "Valkyrie Small Caps", "Valkyrie", Georgia, serif;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: lowercase;
}

.pdf-header > div > p:last-child {
	max-width: 42rem;
	margin: 0.6rem 0 0;
	color: var(--portfolio-muted);
	font-size: 1rem;
}

.print-instruction {
	margin: 0;
	color: var(--portfolio-muted) !important;
	font-size: 0.8rem !important;
}

.project-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.4rem;
	padding: 0 var(--page-gutter) 3rem;
}

.mobile-project-cards {
	display: none;
}

.project-card {
	display: flex;
	min-width: 0;
	flex-direction: column;
	border: 1px solid color-mix(in srgb, var(--portfolio-text) 24%, transparent);
	padding: 0.75rem;
	break-inside: avoid;
}

.project-card > img,
.project-card-placeholder {
	display: grid;
	width: 100%;
	aspect-ratio: 1;
	height: auto;
	margin-bottom: 0.8rem;
	object-fit: cover;
	place-items: center;
	background: color-mix(in srgb, var(--portfolio-text) 7%, transparent);
	color: var(--accent);
	font-size: 3rem;
}

.project-card > div:last-child {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
}

.project-card h2 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 400;
	line-height: 1.2;
}

.project-card p:not(.eyebrow) {
	margin: 0.5rem 0;
	font-size: 0.9rem;
	line-height: 1.45;
}

.project-card .project-client {
	margin-top: auto !important;
	color: var(--portfolio-muted);
	font-size: 0.8rem !important;
}

.project-card .project-date {
	color: var(--portfolio-muted);
	font-size: 0.8rem !important;
}

.project-card a {
	margin-top: 0.4rem;
	font-size: 0.82rem;
}

@media (max-width: 820px) {
	.portfolio-header {
		grid-template-columns: auto 1fr;
		gap: 0.6rem;
		padding-top: 0.55rem;
		padding-bottom: 0.55rem;
	}

	.portfolio-header nav {
		justify-content: flex-end;
	}

	.star {
		width: 34px;
		height: 34px;
	}

	.project-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	body.portfolio-page:not(.pdf-page) {
		height: auto;
		min-height: 100vh;
		overflow-x: hidden;
		overflow-y: auto;
	}

	.portfolio-page:not(.pdf-page) .portfolio-header {
		position: sticky;
		top: 0;
		grid-template-columns: 1fr auto;
		background: var(--portfolio-background);
	}

	.portfolio-page:not(.pdf-page) .constellation-main,
	.portfolio-page:not(.pdf-page) .project-stats {
		display: none;
	}

	.portfolio-page:not(.pdf-page) .portfolio-header nav {
		gap: 0.25rem;
	}

	.theme-toggle {
		right: var(--page-gutter);
		bottom: var(--page-gutter);
	}

	.portfolio-page:not(.pdf-page) .connection-toggles {
		display: none;
	}

	.portfolio-page:not(.pdf-page) .print-link {
		grid-column: 2;
	}

	.portfolio-page:not(.pdf-page).timeline-mode .constellation-main,
	.portfolio-page:not(.pdf-page).topic-mode .constellation-main {
		display: block;
		height: min(70vh, 640px);
		min-height: 460px;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 0.45rem 0 0.8rem;
	}

	.portfolio-page:not(.pdf-page).timeline-mode .constellation-shell,
	.portfolio-page:not(.pdf-page).topic-mode .constellation-shell {
		width: 1000px;
		min-width: 1000px;
		height: 100%;
	}

	.mobile-project-cards {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: 1rem;
		padding: 1rem var(--page-gutter) 4.5rem;
	}

	.portfolio-page:not(.pdf-page).timeline-mode .mobile-project-cards,
	.portfolio-page:not(.pdf-page).topic-mode .mobile-project-cards {
		display: none;
	}

	.mobile-project-cards .project-card {
		display: grid;
		grid-template-columns: minmax(5rem, 0.38fr) minmax(0, 1fr);
		align-items: start;
		gap: 0.8rem;
		padding: 0.65rem;
	}

	.mobile-project-cards .project-card > img,
	.mobile-project-cards .project-card-placeholder {
		width: 100%;
		aspect-ratio: 1;
		height: auto;
		margin: 0;
	}

	.mobile-project-cards .project-card h2 {
		font-size: 1.12rem;
	}

	.mobile-project-cards .project-card p:not(.eyebrow) {
		margin: 0.35rem 0;
		font-size: 0.8rem;
	}

	.mobile-project-cards .project-card .eyebrow {
		font-size: 0.66rem;
	}

	.mobile-project-cards .project-card .project-client {
		margin-top: 0.4rem !important;
	}

	.mobile-project-cards .project-card a {
		font-size: 0.75rem;
	}
}

@media print {
	.portfolio-page {
		color-scheme: light;
		--portfolio-background: #fff;
		--portfolio-text: #0f0326;
		--portfolio-muted: #555;
	}

	body.portfolio-page {
		min-height: 0;
		overflow: visible;
		background: #fff;
		color: #0f0326;
		font-size: 10pt;
	}

	.pdf-header {
		padding: 0 0 1.5rem;
	}

	.project-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.8rem;
		padding: 0;
	}

	.project-card {
		border-color: #aaa;
		padding: 0.5rem;
	}

	.project-card > img,
	.project-card-placeholder {
		max-height: 10rem;
	}

	.project-card h2 {
		font-size: 13pt;
	}

	.project-card p:not(.eyebrow) {
		font-size: 9pt;
	}

	.project-card a {
		font-size: 8pt;
	}
}

.portfolio-embed {
	--portfolio-background: var(--background);
	--portfolio-text: var(--text);
	--portfolio-muted: var(--muted);
	margin-top: clamp(1rem, 2vw, 1.5rem);
}

.portfolio-embed__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem 1.5rem;
	margin-bottom: 0;
}

.portfolio-embed .constellation-main {
	display: block;
	width: 100%;
	height: auto;
	padding: 0;
}

.portfolio-embed .constellation-shell {
	height: clamp(25rem, 40vw, 34rem);
	min-height: 25rem;
	border: 0;
	background: radial-gradient(
		ellipse at 50% 52%,
		color-mix(in srgb, var(--background) 90%, var(--accent-lilac)) 0%,
		var(--background) 72%
	);
}

.portfolio-embed .connections,
.portfolio-embed .timeline-axis {
	z-index: 0;
}

.portfolio-embed .constellation {
	z-index: 2;
}

.portfolio-embed .cluster-label {
	color: var(--accent);
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.portfolio-embed .star {
	border: 2px solid var(--accent);
	box-shadow: 0 0 0 2px var(--background);
}

.portfolio-embed .project-stats-icon {
	filter: brightness(0);
}

.portfolio-embed .project-stats p {
	font-size: inherit;
}

#project-constellation .mobile-project-cards {
	display: none;
}

@media (max-width: 680px) {
	.portfolio-embed__controls {
		align-items: flex-end;
		flex-direction: column;
	}

	.portfolio-embed .connection-toggles {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-end;
		max-width: 100%;
		margin-left: 0;
	}

	.portfolio-embed .view-toggles {
		justify-content: flex-end;
	}

	.portfolio-embed .connection-toggle-label {
		flex-basis: 100%;
		text-align: right;
	}

	.portfolio-embed .constellation-main {
		overflow-x: auto;
		overflow-y: hidden;
	}

	.portfolio-embed .constellation-shell {
		width: 650px;
		min-width: 650px;
		height: 400px;
		min-height: 400px;
	}

	.portfolio-embed .project-stats {
		gap: 0.25rem;
		padding: 0.35rem 0.4rem;
		font-size: 0.6rem;
	}

	.portfolio-embed .project-stats-icon {
		width: 1rem;
		height: 1rem;
	}
}
