/*
	CheckBox Innovations — placeholder page
	Design adapted from "Eventually" by HTML5 UP (html5up.net) under the CCA 3.0 license.
*/

/* Font ------------------------------------------------------------------- */

@font-face {
	font-family: 'Roboto';
	font-style: normal;
	font-weight: 400 700;
	font-stretch: 100%;
	font-display: swap;
	src: url('/assets/fonts/roboto-latin-var.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
	               U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
	               U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens ----------------------------------------------------------------- */

:root {
	--brand-navy: #034761;
	--brand-teal: #1cb09f;
	--fg-muted: rgba(255, 255, 255, 0.55);
	--gutter: 4rem;

	--slide-count: 3;
	--slide-hold: 6s;      /* time each image is fully visible */
	--slide-fade: 1.5s;    /* crossfade duration */
	--slide-cycle: 18s;    /* --slide-hold * --slide-count */
}

@media (max-width: 736px) {
	:root { --gutter: 2rem; }
}

@media (max-width: 360px) {
	:root { --gutter: 1.25rem; }
}

/* Base ------------------------------------------------------------------- */

*, *::before, *::after {
	box-sizing: border-box;
}

html {
	height: 100%;
}

body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100%;
	margin: 0;
	padding: var(--gutter);
	padding-bottom: calc(var(--gutter) + 3.5rem);
	background-color: #000;
	color: #fff;
	font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

/* Background slideshow --------------------------------------------------- */

.bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	opacity: 0.7;
}

/* The wordmark is dark navy, and the three photos vary a lot in brightness.
   This scrim keeps the logo and footer legible on all of them. */
.bg::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		radial-gradient(ellipse 60% 55% at 50% 45%, rgba(0, 0, 0, 0.55), transparent 70%),
		linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 35%);
}

.bg__slide {
	position: absolute;
	inset: 0;
	width: 150%;
	opacity: 0;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	animation:
		slide-fade var(--slide-cycle) linear infinite,
		slide-pan 45s linear infinite;
}

/* Stagger each slide by one hold interval; the negative offset on the first
   slide means the page opens on a fully visible image instead of black. */
.bg__slide--1 {
	background-image: url('/images/bg5.webp');
	animation-delay: calc(var(--slide-fade) * -1), 0s;
}

.bg__slide--2 {
	background-image: url('/images/bg3.webp');
	animation-delay: calc(var(--slide-hold) - var(--slide-fade)), 0s;
}

.bg__slide--3 {
	background-image: url('/images/bg4.webp');
	animation-delay: calc(var(--slide-hold) * 2 - var(--slide-fade)), 0s;
}

/* A lone slide (the 404 page) must not run the crossfade, or it would spend
   most of the cycle faded out to black. Pan only. */
.bg__slide:only-child {
	opacity: 1;
	animation: slide-pan 45s linear infinite;
}

@keyframes slide-fade {
	0%      { opacity: 0; }
	8.333%  { opacity: 1; }   /* --slide-fade / --slide-cycle */
	33.333% { opacity: 1; }   /* --slide-hold / --slide-cycle */
	41.666% { opacity: 0; }
	100%    { opacity: 0; }
}

@keyframes slide-pan {
	from { transform: translateX(0); }
	to   { transform: translateX(-25%); }
}

/* Content ---------------------------------------------------------------- */

.page,
.footer {
	position: relative;
	z-index: 1;
}

.header {
	text-align: center;
}

.logo {
	width: 316px;
	max-width: min(100%, 20rem);
	height: auto;
	filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.55));
}

.tagline {
	margin: 1.25rem 0 0;
	font-size: 1.35rem;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

@media (max-width: 736px) {
	.tagline { font-size: 1rem; }
}

.tagline__link {
	color: #fff;
	text-decoration-color: rgba(255, 255, 255, 0.5);
	text-underline-offset: 3px;
}

.tagline__link:hover,
.tagline__link:focus-visible {
	text-decoration-color: currentColor;
}

.tagline__link:focus-visible {
	outline: 2px solid var(--brand-teal);
	outline-offset: 3px;
	border-radius: 3px;
}

/* Footer ----------------------------------------------------------------- */

.footer {
	position: absolute;
	bottom: var(--gutter);
	left: var(--gutter);
}

/* Once the viewport gets short, let the footer sit in normal flow so it can
   never collide with the centred logo. */
@media (max-height: 640px) {
	.footer {
		position: static;
		margin-top: 2rem;
		text-align: center;
	}

	body { padding-bottom: var(--gutter); }
}

.contact {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--fg-muted);
	font-size: 0.95rem;
	text-decoration: none;
	transition: color 0.25s ease;
}

.contact:hover,
.contact:focus-visible {
	color: #fff;
}

.contact:focus-visible {
	outline: 2px solid var(--brand-teal);
	outline-offset: 4px;
	border-radius: 3px;
}

.contact__icon {
	flex: none;
}

/* Motion preferences ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.bg__slide {
		animation: none;
	}

	.bg__slide--1 {
		opacity: 1;
	}

	.contact {
		transition: none;
	}
}
