/* =========================================================
   CONFIG
   ========================================================= */

:root {
	--hero-bg: #f3ede1;
	--content-bg: #ffffff;

	--header-height: clamp(56px, 5vw, 72px);
	--hero-header-height: var(--header-height);
	--hero-chrome-top: 50%;
	--hero-tagline-top: auto;

	--site-gutter: clamp(18px, 2.5vw, 40px);

	/*
	 * 0.72 closely matches your first screenshot.
	 * Smaller = smaller initial video.
	 */
	--hero-start-scale: 0.72;

	/*
	 * JS overwrites this according to viewport height.
	 */
	--hero-transition-distance: 720px;

	/*
	 * WordPress logged-out default.
	 */
	--wp-admin-offset: 0px;
}


/* WordPress admin toolbar. */

body.admin-bar {
	--wp-admin-offset: 32px;
}

@media (max-width: 782px) {
	body.admin-bar {
		--wp-admin-offset: 46px;
	}
}


/* =========================================================
   BASE
   ========================================================= */

.has-hero-scroll {
	background: var(--hero-bg);
}


/* =========================================================
   FIXED HEADER
   ========================================================= */

.site-header--hero {
	position: fixed;

	top: var(--wp-admin-offset);
	left: 0;

	z-index: 50;

	width: 100%;
	height: var(--header-height);

	background: var(--hero-bg);
}


.site-header--hero.uk-padding-small {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}


.site-header__inner {
	position: relative;

	width: 100%;
	height: 100%;
}


.site-header--hero .site-header__inner {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}


/* =========================================================
   LOGO
   ========================================================= */

/*
 * Final / no-JS state.
 */

.site-header__brand {
	position: absolute;

	top: var(--hero-chrome-top);
	left: var(--site-gutter);

	z-index: 2;

	transform:
		translateY(-50%)
		scale(1);

	transform-origin: center;

	white-space: nowrap;
}


/*
 * Initial animation state.
 *
 * This only applies when JS is available.
 */

.js .has-hero-scroll .site-header__brand {
	left: 50%;

	transform:
		translate(-50%, -50%)
		scale(1.5);
}


.site-header__brand .custom-logo-link {
	display: block;

	line-height: 0;
}


.site-header__brand .custom-logo {
	display: block;
	width: auto;
	max-width: clamp(110px, 12vw, 335px);
	height: clamp(30px, 4vw, 72px);
	object-fit: contain;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.site-header__nav {
	position: absolute;

	top: var(--hero-chrome-top);
	left: 50%;

	z-index: 1;

	transform: translate(-50%, -50%);

	opacity: 1;
	visibility: visible;

	white-space: nowrap;
}


.site-header--hero .site-header__nav > [uk-navbar],
.site-header--hero .site-header__nav .uk-navbar,
.site-header--hero .uk-navbar-nav {
	display: flex;
	align-items: center;

	min-height: 0 !important;
	height: auto !important;

	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;

	line-height: inherit !important;
}


.site-header--hero .uk-navbar-nav > li,
.site-header--hero .uk-navbar-nav > li > a {
	display: flex;
	align-items: center;

	min-height: 0 !important;
	height: auto !important;

	margin-top: 0 !important;
	margin-bottom: 0 !important;

	line-height: inherit !important;
}


.site-header--hero .uk-navbar-nav > li > a {
	padding-top: 0 !important;
	padding-bottom: 0 !important;

	line-height: inherit !important;
}


/*
 * Initial JS state:
 * menu starts above the header and invisible.
 */

.js .has-hero-scroll .site-header__nav {
	transform: translate(-50%, -160%);

	opacity: 0;
	visibility: hidden;
}


.primary-menu {
	display: flex;
	align-items: center;

	gap: clamp(12px, 1.3vw, 24px);

	margin: 0;
	padding: 0;

	list-style: none;
}


.primary-menu a {
	display: block;

	color: inherit;

	font-size: clamp(10px, 0.72vw, 13px);
	font-weight: 500;

	line-height: 1;

	text-decoration: none;
	text-transform: uppercase;

	letter-spacing: 0.02em;
}


.primary-menu a:hover,
.primary-menu a:focus-visible {
	opacity: 0.55;
}


/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.site-header__actions {
	position: absolute;

	top: var(--hero-chrome-top);
	right: var(--site-gutter);

	z-index: 3;

	display: flex;
	align-items: center;

	gap: 14px;

	transform: translateY(-50%);
}


.site-header--hero .site-header__actions .uk-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* line-height: 1; */
}


/*
 * Slightly inset in the landing composition.
 *
 * GSAP moves this outward toward --site-gutter.
 */

.js .has-hero-scroll .site-header__actions {
	right: clamp(28px, 7vw, 92px);
}


.book-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-height: 28px;

	padding: 7px 10px;

	background: #f0b400;
	color: #111;

	font-size: 10px;
	font-weight: 600;

	line-height: 1;

	text-decoration: none;
	text-transform: uppercase;

	transition:
		transform 180ms ease,
		background-color 180ms ease;
}


.book-button:hover {
	transform: translateY(-1px);
}


.book-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}


/* =========================================================
   FIXED HERO STAGE
   ========================================================= */

.hero-stage {
	position: fixed;

	inset:
		var(--wp-admin-offset)
		0
		0
		0;

	z-index: 0;

	overflow: hidden;

	background: var(--hero-bg);

	pointer-events: none;
}


/* =========================================================
   VIDEO
   ========================================================= */

/*
 * IMPORTANT:
 *
 * The element is already the FINAL dimensions.
 *
 * It stays fixed under the header forever.
 *
 * The "small hero" state is produced only by scale().
 */

.hero-media {
	position: fixed;

	top: calc(
		var(--wp-admin-offset) +
		var(--hero-header-height)
	);

	right: 0;
	bottom: 0;
	left: 0;

	z-index: 1;

	overflow: hidden;

	transform: scale(1);
	transform-origin: 50% 50%;
}


/*
 * Initial animation state.
 */

.js .has-hero-scroll .hero-media {
	transform: scale(var(--hero-start-scale));

	will-change: transform;
}


.hero-media__video {
	display: block;

	width: 100%;
	height: 100%;

	object-fit: cover;

	/*
	 * Adjust according to the composition of your actual footage.
	 */
	object-position: center center;
}


/* =========================================================
   INITIAL TAGLINE
   ========================================================= */

.hero-tagline {
	position: fixed;

	right: var(--site-gutter);
	top: var(--hero-tagline-top);
	bottom: auto;
	left: var(--site-gutter);

	z-index: 2;

	margin: 0;

	color: #111;

	font-size: clamp(9px, 0.65vw, 12px);
	font-weight: 500;

	line-height: 1.2;

	text-align: center;
	text-transform: uppercase;

	letter-spacing: 0.01em;

	opacity: 0;

	pointer-events: none;
}


/*
 * Show only as part of JS-enhanced initial state.
 */

.js .has-hero-scroll .hero-tagline {
	opacity: 1;
}


/* =========================================================
   SCROLL DRIVER
   ========================================================= */

/*
 * No JS:
 * hero gets exactly one viewport of normal document space.
 */

.hero-scroll-driver {
	position: relative;

	z-index: 1;

	width: 100%;
	height: 100svh;

	pointer-events: none;
}


/*
 * JS adds .hero-scroll-ready once everything is initialized.
 *
 * One viewport
 * +
 * animation distance
 *
 * This is what makes the next section arrive precisely when
 * the hero animation has completed.
 */

.hero-scroll-ready .hero-scroll-driver {
	height: calc(
		100svh +
		var(--hero-transition-distance)
	);
}


.hero-scroll-complete .hero-media {
	transform: scale(1);
}


.hero-scroll-complete .site-header__brand {
	top: var(--hero-chrome-top);
	left: var(--site-gutter);

	transform:
		translateY(-50%)
		scale(1);
}


.hero-scroll-complete .site-header__nav {
	top: var(--hero-chrome-top);

	opacity: 1;
	visibility: visible;
}


.hero-scroll-complete .site-header__actions {
	top: var(--hero-chrome-top);
	right: var(--site-gutter);
}


/* =========================================================
   NORMAL CONTENT ABOVE THE VIDEO
   ========================================================= */

.site-main--over-hero {
	position: relative;

	z-index: 10;

	width: 100%;

	background: var(--content-bg);
}


/*
 * Every section now naturally covers the fixed video
 * because the entire main area is opaque and above it.
 */

.content-section {
	position: relative;

	min-height: 100svh;

	padding: clamp(70px, 10vw, 150px) var(--site-gutter);

	background: var(--content-bg);
}


/* =========================================================
   MOBILE MENU
   ========================================================= */

.mobile-menu-toggle {
	display: none;

	width: 36px;
	height: 36px;

	padding: 8px;

	border: 0;

	background: transparent;

	cursor: pointer;
}


.mobile-menu-toggle > span:not(.screen-reader-text) {
	display: block;

	width: 100%;
	height: 1px;

	margin: 5px 0;

	background: currentColor;
}


@media (max-width: 900px) {

	:root {
		--hero-start-scale: 0.86;
		--header-height: 60px;
	}


	/*
	 * Don't attempt to squeeze the desktop navigation into
	 * the center on a phone.
	 */

	.site-header__nav {
		display: none;

		position: fixed;

		top: calc(
			var(--wp-admin-offset) +
			var(--header-height)
		);

		right: 12px;
		left: 12px;

		transform: none !important;

		padding: 24px;

		background: var(--hero-bg);

		opacity: 1 !important;
		visibility: visible !important;

		pointer-events: auto;
	}


	.site-header__nav.is-open {
		display: block;
	}


	.primary-menu {
		flex-direction: column;
		align-items: flex-start;

		gap: 18px;
	}


	.primary-menu a {
		font-size: 14px;
	}


	.mobile-menu-toggle {
		display: block;
	}


	.book-button {
		font-size: 9px;

		padding-inline: 8px;
	}


	.js .has-hero-scroll .site-header__brand {
		transform:
			translate(-50%, -50%)
			scale(1.18);
	}

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.screen-reader-text {
	position: absolute !important;

	width: 1px;
	height: 1px;

	padding: 0;
	margin: -1px;

	overflow: hidden;

	clip: rect(0, 0, 0, 0);

	white-space: nowrap;

	border: 0;
}


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

	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
