/* moonlight.pm: Big Sky. See DESIGN.md. No script: the land (sky.svg,
   ridge.svg) is drawn by the server at start; this file places it. */

/* Latin subsets from Google Fonts. EB Garamond's includes U+0131, the
   dotless i the wordmark needs; its roman is variable 400–600. */
@font-face {
	font-family: 'EB Garamond';
	src: url('/fonts/EBGaramond.woff2') format('woff2');
	font-weight: 400 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'EB Garamond';
	src: url('/fonts/EBGaramond-Italic.woff2') format('woff2');
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: 'Josefin Sans';
	src: url('/fonts/JosefinSans.woff2') format('woff2');
	font-weight: 300 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--sky-top: #060919;
	--sky-mid: #0b1030;
	--sky-low: #1b2150;
	--ground: #05070e;
	--foil: #d9bb84;
	--foil-hot: #f3e2b4;
	--ink: #ebe3d1;
	--mute: #8f95ad;
	--serif: 'EB Garamond', Garamond, serif;
	--deco: 'Josefin Sans', 'Futura', sans-serif;
	color-scheme: dark;
}

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

html {
	background: var(--ground);
}

body {
	margin: 0;
	color: var(--ink);
	font-family: var(--serif);
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--foil);
	color: var(--ground);
}

/* The sky fills the window; the ground (the work) sits at the bottom. */
.night {
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-top: 6.5rem;
	overflow: hidden;
	background: linear-gradient(
		180deg,
		var(--sky-top) 0%,
		var(--sky-mid) 38%,
		var(--sky-low) 64%,
		var(--sky-low) 100%
	);
}

/* Drawn at CSS px and centred, so the stars keep their size and stay off
   the header. */
.sky {
	position: absolute;
	top: 0;
	left: 50%;
	width: 3440px;
	max-width: none;
	height: 1100px;
	margin-left: -1720px;
	pointer-events: none;
	user-select: none;
}

/* The install's own sign-in on this host: quiet, in the tagline's voice. */
.sign-in {
	position: absolute;
	top: 1.7rem;
	right: 2.2rem;
	padding: 0.4rem 0 0.4rem 0.3em;
	font-family: var(--deco);
	font-size: 0.72rem;
	font-weight: 400;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--ink);
	text-decoration: none;
	opacity: 0.66;
	transition: color 0.2s, opacity 0.2s;
}

.sign-in:hover,
.sign-in:focus-visible {
	color: var(--foil-hot);
	opacity: 1;
}

.sign-in:focus-visible {
	outline: 1px solid var(--foil);
	outline-offset: 4px;
}

/* Room for the ridgelines between the mark and the work. */
header {
	position: relative;
	margin: 0 1.5rem 15rem;
	text-align: center;
}

/* The wordmark, after Ideogram tittle-2: lowercase Garamond in gold foil,
   a crescent for the dot of the i, (pm) tucked under "ght". Only the word
   and (pm) clip the foil to text; the tittle is a masked box, so it can be
   positioned without dropping out of the foil. */
.ml-mark {
	--ml-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.25  0 0 0 0 0.18  0 0 0 0 0.08  0 0 0 0.55 -0.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
	--ml-foil: var(--ml-grain),
		linear-gradient(100deg, #b8945c 0%, #d9bb84 22%, #efdcab 44%, #dcbe87 60%, #c09c62 82%, #ab8850 100%);

	position: relative;
	display: inline-block;
	margin: 0;
	padding-bottom: 0.3em;
	font-family: var(--serif);
	font-size: clamp(3.8rem, 7.8vw, 7.4rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.012em;
	white-space: nowrap;
	filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 -1px 0 rgba(255, 236, 190, 0.08));
}

.ml-word,
.ml-pm {
	background: var(--ml-foil);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.ml-tittle {
	position: relative;
	display: inline-block;
	width: 0;
	height: 0;
}

.ml-tittle::before {
	content: '';
	position: absolute;
	left: 0.02em;
	bottom: 0.48em;
	width: 0.22em;
	height: 0.22em;
	background: var(--ml-foil);
	background-size: auto, 400% 100%;
	background-position: 0 0, 40% 0;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M13.5 1.2A9 9 0 1 0 18.8 14 7 7 0 1 1 13.5 1.2Z'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M13.5 1.2A9 9 0 1 0 18.8 14 7 7 0 1 1 13.5 1.2Z'/%3E%3C/svg%3E")
		center / contain no-repeat;
	transform: rotate(-22deg);
}

.ml-pm {
	position: absolute;
	right: 0.01em;
	bottom: 0;
	font-size: 0.3em;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.lede {
	margin: 1.2rem 0 0;
	font-family: var(--deco);
	font-size: 0.86rem;
	font-weight: 300;
	letter-spacing: 0.44em;
	text-transform: uppercase;
	opacity: 0.82;
}

/* The ground: the near ridge's fill carried down to the bottom. The
   ridgelines stand on its top edge. */
.ground {
	position: relative;
	align-self: stretch;
	margin-top: auto;
	padding: 0 4rem 3.4rem;
	background: var(--ground);
}

.ridge {
	position: absolute;
	left: 0;
	bottom: calc(100% - 2px);
	width: 100%;
	height: 252px;
	pointer-events: none;
	user-select: none;
}

.works {
	position: relative;
	list-style: none;
	margin: 0 auto;
	padding: 0;
	width: min(100%, 72rem);
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0 2.6rem;
}

.works a {
	display: block;
	text-align: center;
	color: inherit;
	text-decoration: none;
}

.works a:focus-visible {
	outline: 1px solid var(--foil);
	outline-offset: 6px;
}

/* padding-left offsets the trailing letter-spacing so the name centers. */
.name {
	display: block;
	padding-left: 0.32em;
	font-family: var(--deco);
	font-size: 1.12rem;
	font-weight: 400;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	transition: color 0.2s;
}

.works a:hover .name,
.works a:focus-visible .name {
	color: var(--foil-hot);
}

.host {
	display: block;
	margin-top: 0.15rem;
	font-size: 1rem;
	font-style: italic;
	color: var(--foil);
}

.copy {
	display: block;
	margin-top: 0.5rem;
	font-size: 1.04rem;
	line-height: 1.38;
	color: var(--mute);
}

/* Not found: the tagline's voice, one way home. */
.back {
	margin: 1.4rem 0 0;
	font-size: 1.2rem;
	font-style: italic;
}

.back a {
	color: var(--foil);
	text-decoration: none;
}

.back a:hover,
.back a:focus-visible {
	color: var(--foil-hot);
}

@media (max-width: 760px) {
	.night {
		padding-top: 4.6rem;
	}

	/* Drawn for a 390px phone; scales with the width, as the mark does. */
	.sky {
		left: 0;
		width: 100%;
		height: auto;
		margin-left: 0;
	}

	.sign-in {
		top: 0.9rem;
		right: 1rem;
		font-size: 0.62rem;
	}

	.ml-mark {
		font-size: 15.5vw;
	}

	.lede {
		font-size: 0.6rem;
		letter-spacing: 0.2em;
	}

	.ground {
		padding: 0 1.5rem 3rem;
	}

	.ridge {
		height: 159px;
	}

	.works {
		grid-template-columns: 1fr;
		gap: 1.6rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.name,
	.sign-in {
		transition: none;
	}
}
