/* ==========================================================================
   Cave Cay — tokens
   ========================================================================== */
:root {
	--color-bg: #000;
	--color-text: #fff;
	--color-rule: #666;

	--font-display: "Marcellus SC", "Times New Roman", serif;
	--font-body: "Marcellus", "Times New Roman", serif;
	--font-sans: "Outfit", system-ui, sans-serif;

	--page-pad: clamp(16px, 2.05vw, 31px);
	--content-width: 700px;

	--hero-height: clamp(440px, 47.4vw, 717px);
	--hero-fade: 160px;

	--space-hero-intro: clamp(36px, 3.25vw, 49px);
	--space-heading-body: 30px;
	--space-intro-logos: clamp(80px, 9.9vw, 150px);
	--space-main-footer: clamp(72px, 7.8vw, 118px);
	--space-rule-copy: clamp(28px, 2.5vw, 38px);

	--body-size: clamp(16px, 1.19vw, 18px);
	--body-leading: 1.7;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--body-size);
	line-height: var(--body-leading);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

h1,
h2,
p,
blockquote,
figure {
	margin: 0;
}

/* No widows: balance short headings, avoid single-word last lines in copy. */
h1,
h2 {
	text-wrap: balance;
}

p,
blockquote,
figcaption {
	text-wrap: pretty;
}

.site {
	padding: var(--page-pad);
	overflow-x: clip;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
	position: relative;
	display: grid;
	place-items: center;
	height: var(--hero-height);
	overflow: hidden;
	isolation: isolate;
}

.hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	/* Gives the multiply-blended vignette a dark backdrop while the image loads;
	   without it the raw gradient flashes on screen. */
	background: var(--color-bg);
}

.hero__slides {
	position: absolute;
	inset: 0;
	z-index: 0; /* contain slide z-indexes below the overlays */
}

/* Slides stack; JS crossfades them. Non-first slides stay hidden until then
   (and for good without JS or with reduced motion). */
.hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.hero__image:not(:first-child) {
	opacity: 0;
	visibility: hidden;
}

/* Bottom fade into the page background. */
.hero__media::before {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: var(--hero-fade);
	background: linear-gradient(to bottom, rgb(0 0 0 / 0), var(--color-bg));
	z-index: 1;
}

/* Soft teal vignette behind the wordmark for legibility. */
.hero__media::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(680px, 90%);
	aspect-ratio: 680 / 528;
	translate: -50% -50%;
	background: radial-gradient(
		closest-side,
		#154a5c 0%,
		#326170 12.5%,
		#507785 25%,
		#6d8e99 37.5%,
		#8aa5ae 50%,
		#c5d2d6 75%,
		#fff 100%
	);
	mix-blend-mode: multiply;
	opacity: 0.78;
}

.hero__title {
	padding-inline: 16px;
	font-family: var(--font-display);
	font-weight: 400;
	font-size: clamp(36px, 3.97vw, 60px);
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-align: center;
}

/* ==========================================================================
   Intro
   ========================================================================== */
.intro {
	max-width: var(--content-width);
	margin: var(--space-hero-intro) auto 0;
	/* Design ends the copy block with one empty body line before the gap. */
	padding-bottom: calc(var(--body-leading) * 1em);
	text-align: center;
}

.intro__heading {
	margin-bottom: var(--space-heading-body);
	font-family: var(--font-sans);
	font-weight: 800;
	font-size: clamp(13px, 1.06vw, 16px);
	line-height: 1.5;
	letter-spacing: 0.33em;
	text-transform: uppercase;
}

.intro__body p {
	margin-bottom: calc(var(--body-leading) * 1em);
}

.intro__body p:last-child {
	margin-bottom: 0;
}

.quote {
	margin-top: calc(var(--body-leading) * 1em);
}

.quote__cite {
	margin-top: 12px;
	font-family: var(--font-sans);
	font-size: 14px;
	line-height: 1.7;
}

.quote__cite strong {
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px;
}

/* ==========================================================================
   Logos (optional)
   ========================================================================== */
.logos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 32px clamp(40px, 4.76vw, 72px);
	margin: var(--space-intro-logos) auto 0;
	padding: 0;
	list-style: none;
}

.logos__image {
	width: auto;
	height: 33px;
	max-width: 160px;
	object-fit: contain;
}

.logos__link {
	display: block;
	transition: opacity 0.2s ease;
}

.logos__link:hover,
.logos__link:focus-visible {
	opacity: 0.7;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
	margin-top: var(--space-main-footer);
	padding-top: var(--space-rule-copy);
	border-top: 1px solid var(--color-rule);
	text-align: center;
}

.site-footer__copyright {
	font-family: var(--font-display);
	font-size: 11px;
	line-height: 1.5;
	letter-spacing: 0.29em;
	text-transform: uppercase;
}

/* ==========================================================================
   Animation pre-state (only when JS is running; see assets/js/main.js)
   ========================================================================== */
html.js .js-anim {
	visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
	html.js .js-anim {
		visibility: visible;
	}
}
