/* ---------- Base ---------- */
html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: #fff;
	color: #000;
	font-family: "DM Serif Text", serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

a,
a:hover,
a:focus,
a:active {
	color: inherit;
	text-decoration: none;
}

.elementor-widget-text-editor p {
	margin: 0;
}

.elementor-widget-text-editor em.hj-accent {
	font-family: "EB Garamond", serif;
	font-style: italic;
	font-weight: 800;
}

/* ---------- Rive ---------- */
canvas.hj-rive {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
}

/* Header: nav items are a Rive canvas with the label centred on top. */
.hj-nav {
	position: relative;
}

.hj-nav .elementor-widget-html {
	position: absolute;
	inset: 0;
	width: 100%;
}

.hj-nav canvas.hj-rive {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 180px;
	height: 90px;
	transform: translate(-50%, -50%);
}

.hj-nav .elementor-widget-heading {
	position: relative;
	pointer-events: none;
}

/* The original only shows About / Projects on the home page; inner pages get a taller, logo-only header. */
body:not(.home):not(.elementor-editor-active) .hj-nav {
	display: none;
}

body:not(.home) .hj-header {
	min-height: 108px;
}

.hj-logo canvas.hj-rive {
	width: 88px;
	height: 88px;
}

.hj-logo a {
	display: block;
}

/* Sticky portrait on tablet, as in the original. */
@media (min-width: 768px) and (max-width: 1199px) {
	.hj-about-photo {
		position: sticky;
		top: 0;
		z-index: 1;
	}
}

/* ---------- Media ---------- */
.elementor-widget-video .elementor-wrapper,
.elementor-widget-video video {
	display: block;
	width: 100%;
}

.hj-square video {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.hj-cover-169 video {
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.hj-shadow img {
	filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.25));
}

/* ---------- Ticker ---------- */
.hj-ticker {
	overflow: hidden;
	white-space: nowrap;
	user-select: none;
}

.hj-ticker__track {
	display: inline-flex;
	gap: 10px;
	animation: hj-ticker var(--hj-ticker-duration, 43s) linear infinite;
	will-change: transform;
}

.hj-ticker__item {
	flex: none;
	white-space: pre;
	font-family: "DM Serif Display", serif;
	font-size: 41.12px;
	line-height: 1.2;
	color: #858585;
}

@media (max-width: 767px) {
	.hj-ticker__item {
		font-size: 34.72px;
	}
}

@keyframes hj-ticker {
	to {
		transform: translate3d(calc(-50% - 5px), 0, 0);
	}
}

/* ---------- Entrance animations (Elementor "Fade In Left/Right/Up", tuned to the Framer values) ---------- */
.elementor-element.animated.fadeInLeft,
.elementor-element.animated.fadeInRight,
.elementor-element.animated.fadeInUp {
	animation-duration: 1s;
	animation-timing-function: cubic-bezier(0, 0.33, 0.33, 1);
}

.elementor-element.animated.fadeInLeft {
	animation-name: hj-in-left;
}

.elementor-element.animated.fadeInRight {
	animation-name: hj-in-right;
}

.elementor-element.animated.fadeInUp {
	animation-name: hj-in-up;
	animation-timing-function: cubic-bezier(0.6, 0.02, 0.33, 1);
}

@keyframes hj-in-left {
	from {
		opacity: 0;
		transform: translate3d(-80px, 0, 0);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes hj-in-right {
	from {
		opacity: 0;
		transform: translate3d(80px, 0, 0);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes hj-in-up {
	from {
		opacity: 0;
		transform: translate3d(0, 100px, 0);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Custom cursor ---------- */
.hj-cursor {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 99999;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border-radius: 50%;
	background: #fff;
	mix-blend-mode: exclusion;
	pointer-events: none;
	opacity: 0;
	transition: width 0.4s cubic-bezier(0.3, 1.35, 0.55, 1), height 0.4s cubic-bezier(0.3, 1.35, 0.55, 1),
		margin 0.4s cubic-bezier(0.3, 1.35, 0.55, 1), opacity 0.2s linear;
	will-change: transform;
}

.hj-cursor.is-visible {
	opacity: 1;
}

.hj-cursor.is-active {
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
}

html.hj-has-cursor,
html.hj-has-cursor * {
	cursor: none !important;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.hj-ticker__track {
		animation: none;
	}
}

/* Mobile logo is a static image: 64px on the home page, 88px elsewhere (as in the original). */
body:not(.home) .hj-logo-img img {
	width: 88px;
}

/* Paragraph spacing of the About copy (20px in the original). */
.hj-about-text p + p {
	margin-top: 20px;
}

/* The footer e-mail wraps mid-word on narrow screens instead of overflowing. */
.hj-email .elementor-heading-title {
	overflow-wrap: anywhere;
}

/* Privacy notice: links must be recognisable inside running text. */
.hj-legal a {
	text-decoration: underline;
}
