/* ------------------------------------------------------------ home screen --- */

/* Starts transparent over the gradient, then fades up to its configured
   opacity — reads as the background crossfading from gradient to video. */
@keyframes gb-bg-in {
	from {
		opacity: 0;
	}
	to {
		opacity: var(--gb-video-opacity, 0.75);
	}
}

.gb-home-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
	animation: gb-bg-in 2.4s ease 2.6s forwards;
}

@media (prefers-reduced-motion: reduce) {
	.gb-home-bg {
		animation: none;
		opacity: var(--gb-video-opacity, 0.75);
	}
}

.gb-home-bg__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.gb-home-screen {
	position: relative;
	min-height: 100vh;
	z-index: 1;
}

/* Two rotated rails, echoing the original -90deg home links.
   After rotate(-90deg): local +x runs up the screen, local +y runs right.
   So the rail's own top edge is the screen-left edge, and the stacked
   eyebrow/headline read left-to-right on screen, bottom-to-top. */
.gb-home-link-wrap {
	position: fixed;
	top: 0;
	width: 100vh;
	height: var(--gb-rail);
	display: flex;
	align-items: flex-start;
	transform-origin: 0 0;
	transform: rotate(-90deg) translate(-100%, 0);
	z-index: 15;
}

/* Becomes the full-height vertical rule on screen. Drawn in via scaleX:
   the wrap's local x-axis is screen-vertical, so anchoring the scale at
   local-left/local-right draws it from screen-bottom/top respectively. */
.gb-home-link-wrap::before {
	content: '';
	position: absolute;
	left: 0;
	top: 21px;
	width: 100%;
	height: 1px;
	background: var(--gb-line);
	transform: scaleX(0);
	animation: gb-line-draw 0.9s cubic-bezier(0.22, 0.7, 0.2, 1) forwards;
}

/* Local left = screen bottom, so this draws up the page. */
.gb-home-link--one::before {
	transform-origin: 0 0;
}

/* Local right = screen top, so this draws down the page. */
.gb-home-link--two::before {
	transform-origin: 100% 0;
}

@keyframes gb-line-draw {
	to {
		transform: scaleX(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gb-home-link-wrap::before {
		animation: none;
		transform: scaleX(1);
	}
}

/* The admin bar pushes html down 32px, so the rails must shorten to match. */
body.admin-bar .gb-home-link-wrap {
	width: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .gb-home-link-wrap {
		width: calc(100vh - 46px);
	}
}

.gb-home-link--one {
	left: calc(33.33% - 21px);
	justify-content: center;
}

/* The second rail sits lower on screen, staggered against the first. */
.gb-home-link--two {
	left: calc(66.66% + 21px);
	justify-content: flex-start;
	padding-left: 10vh;
}

.gb-home-link-wrap:hover {
	z-index: 25;
}

/* The rule sits in the gap between the two spans, so the eyebrow lands on
   one side of it and the headline on the other. */
.gb-home-link {
	position: relative;
	display: block;
	padding: 0;
	text-align: left;
	background: transparent;
}

.gb-home-link .gb-eyebrow {
	margin: 0 0 3px;
	font-size: 14px;
	line-height: 18px;
	letter-spacing: 0;
	color: rgba(255, 255, 255, 0.6);
}

.gb-home-link .gb-headline {
	display: block;
	margin: 0;
	font-family: 'Roboto Condensed', 'Roboto', sans-serif;
	font-weight: 700;
	font-style: normal;
	font-size: 50px;
	line-height: 55px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.5);
	transition: color 0.3s ease;
}

.gb-home-link:hover .gb-headline {
	color: rgba(255, 255, 255, 0.85);
}

/* The entrance @keyframes fill forward and keep owning `transform` after
   they finish, which would block a hover transition on the same property.
   main.js adds .gb-settled on animationend to hand transform back over. */
.gb-home-link .gb-eyebrow.gb-settled,
.gb-home-link .gb-headline.gb-settled {
	animation: none;
	opacity: 1;
	transform: translateX(var(--gb-to, 0));
	transition: transform 0.4s ease, color 0.3s ease;
}

.gb-home-link:hover .gb-eyebrow.gb-settled,
.gb-home-link:hover .gb-headline.gb-settled {
	transform: translateX(var(--gb-hover, 0));
}

.gb-home-link--one .gb-eyebrow { --gb-hover: -10px; }
.gb-home-link--two .gb-eyebrow { --gb-hover: 10px; }
.gb-home-link--one .gb-headline { --gb-hover: -10px; }
.gb-home-link--two .gb-headline { --gb-hover: 10px; }

/* Entrance. The rails are rotated -90deg, so local X is screen vertical:
   +X reads as up on screen, -X as down. Each element declares its own start
   and resting offset, so the eyebrows can settle clear of the headline. */
@keyframes gb-slide {
	from {
		opacity: 0;
		transform: translateX(var(--gb-from, 0));
	}
	to {
		opacity: 1;
		transform: translateX(var(--gb-to, 0));
	}
}

.gb-home-link .gb-eyebrow,
.gb-home-link .gb-headline {
	opacity: 0;
	animation-name: gb-slide;
	animation-duration: 1.1s;
	animation-timing-function: cubic-bezier(0.22, 0.7, 0.2, 1);
	animation-fill-mode: both;
}

/* Local left is screen bottom, local right is screen top: the left rail's
   eyebrow sits at the start of the headline, the right rail's at its end. */
.gb-home-link--one .gb-eyebrow {
	text-align: left;
	--gb-from: -95px;
	--gb-to: -50px;
	animation-delay: 1.15s;
}

.gb-home-link--two .gb-eyebrow {
	text-align: right;
	--gb-from: 95px;
	--gb-to: 50px;
	animation-delay: 1.3s;
}

/* Left rail headline falls in, right rail headline rises. */
.gb-home-link--one .gb-headline {
	--gb-from: 45px;
	--gb-to: 0px;
	animation-delay: 1.25s;
}

.gb-home-link--two .gb-headline {
	--gb-from: -45px;
	--gb-to: 0px;
	animation-delay: 1.4s;
}

@media (prefers-reduced-motion: reduce) {
	.gb-home-link .gb-eyebrow,
	.gb-home-link .gb-headline {
		animation: none;
		opacity: 1;
		transform: translateX(var(--gb-to, 0));
		transition: transform 0.4s ease, color 0.3s ease;
	}

	.gb-home-link:hover .gb-eyebrow,
	.gb-home-link:hover .gb-headline {
		transform: translateX(var(--gb-hover, 0));
	}
}

.gb-home-intro {
	position: relative;
	z-index: 5;
	max-width: 520px;
	margin: 0 auto;
	padding: 40vh var(--gb-edge) 0;
	text-align: center;
}


@media (max-width: 1024px) {
	.gb-home-link-wrap {
		position: relative;
		left: auto !important;
		top: auto;
		width: 100%;
		height: auto;
		transform: none;
		padding: 40px var(--gb-edge);
		justify-content: flex-start;
	}

	.gb-home-link-wrap::before {
		top: 0;
	}

	.gb-home-screen {
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: var(--gb-header-h) 0;
	}

	.gb-home-link {
		padding: 0;
		text-align: left;
	}

	.gb-home-link .gb-headline {
		font-size: 34px;
		line-height: 40px;
	}

	.gb-home-intro {
		padding-top: 40px;
	}
}
