/* ============================================
   Harry Styles (Kyber Edition)
   ============================================ */

@font-face {
	font-family: "Womprat";
	src: url("../fonts/Womprat.woff2") format("woff2");
	font-weight: 700;
	font-display: block;
}

:root {
	--yellow: #efb500;
	--yellow: color(display-p3 0.937 0.71 0);
	--blue: #4ad6ed;
	--kyberCyan: rgb(38, 199, 230);

	/* Set by scripts.js: the app's type scale (column width / 208) */
	--scale: 2px;
}

* {
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
}

html, body {
	height: 100%;
}

body {
	font-family:
		ui-rounded,
		"SF Pro Rounded",
		-apple-system,
		BlinkMacSystemFont,
		Segoe UI,
		Helvetica,
		Arial,
		sans-serif,
		Apple Color Emoji,
		Segoe UI Emoji;
	font-size: 24px;
	font-weight: 500;
	color: #fff;
	background: #000;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
	margin: 0;
}

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
	color: inherit;
	border: 0;
	cursor: pointer;
}

/* ============================================
   The Intro
   ============================================ */

#intro {
	position: fixed;
	inset: 0;
	overflow: hidden;
	background: #000;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;

	.intro-done & {
		cursor: auto;
		touch-action: auto;
	}
}

#stars {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	will-change: transform;
}

/* "A long time ago…" in the film's blue, set like 1977: two lines with roomy word spacing,
   sitting a hair below centre. scripts.js sizes it. */
#opening {
	position: absolute;
	top: 52%;
	left: 50%;
	transform: translate(-50%, -50%);
	white-space: nowrap;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
	font-size: var(--openingFont, 28px);
	font-weight: 600;
	line-height: 1.35;
	word-spacing: 0.12em;
	color: var(--blue);
	opacity: 0;

	&.wrap {
		width: calc(100vw - 48px);
		white-space: normal;
		line-height: 1.3;
		word-spacing: normal;

		br {
			display: none;
		}
	}
}

/* Hollow letters, like the original logo. Pops in a little wider than the screen. */
#logo {
	position: absolute;
	top: 0;
	left: 0;
	width: calc(240 * var(--titleScale));
	overflow: visible;
	opacity: 0;
	will-change: transform, opacity;

	path {
		fill: none;
		stroke: var(--yellow);
		stroke: color(display-p3 0.937 0.733 0.071);
		stroke-width: 3;
	}
}

/* Fades in from the top, like the film's crawl melting into the stars */
#crawlStage {
	position: absolute;
	inset: 0;
	-webkit-mask-image: linear-gradient(to bottom, transparent 12%, #000 42%);
	mask-image: linear-gradient(to bottom, transparent 12%, #000 42%);
}

/* A long plane tipped back about its bottom edge, a touch wider than the screen. The
   perspective and tilt (set by scripts.js) put the horizon just above the top, as in 1977. */
#plane {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: var(--planeWidth);
	height: var(--planeHeight);
	margin-left: calc(var(--planeWidth) / -2);
	transform-origin: 50% 100%;
	transform: perspective(var(--perspective)) rotateX(var(--tilt));
}

#crawl {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
	font-size: var(--crawlFont);
	font-weight: 700;
	color: var(--yellow);
	will-change: transform;

	.episode {
		line-height: 1.3;
		text-align: center;
	}

	.crawlTitle {
		font-size: 2em;
		line-height: 1.2;
		text-align: left;
		white-space: nowrap;
		margin-bottom: 1em;

		span {
			position: relative;
			left: 50%;
			display: inline-block;
			transform-origin: 50% 50%;
		}
	}

	p {
		line-height: 1.3;
		letter-spacing: 0.02em;
		text-align: justify;
		text-align-last: left;
		hyphens: none;
	}

	p + p {
		margin-top: 1.3em;
	}
}

/* ============================================
   Controls
   ============================================ */

.controls {
	position: fixed;
	top: max(16px, env(safe-area-inset-top));
	right: max(16px, env(safe-area-inset-right));
	display: flex;
	gap: 8px;
	z-index: 10;
}

.pill {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	min-width: 36px;
	padding: 0 14px;
	border-radius: 100px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.5px;
	opacity: 0.6;
	transition: opacity 0.3s ease-in-out, visibility 0.3s;

	&:hover {
		opacity: 1;
	}

	svg {
		width: 18px;
		height: 18px;
	}
}

#sound {
	padding: 0;

	.waves {
		display: none;
	}

	&[aria-pressed="true"] {
		.waves {
			display: inline;
		}

		.mute {
			display: none;
		}
	}
}

/* ============================================
   The Page (rises up at the end of the crawl)
   ============================================ */

#page {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	pointer-events: none;

	/* Below the screen until the tilt down brings each piece up (scripts.js) */
	.intro-playing & {
		overflow: hidden;

		.hero > *, .footer {
			translate: 0 100vh;
		}
	}

	.intro-done & {
		pointer-events: auto;
	}
}

.hero {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 560px;
	padding: 24px;
	text-align: center;

	.appIcon {
		width: 200px;
		padding: 60px;
		margin: -60px;
		box-sizing: content-box;
		transform: translateY(40px);
		z-index: 1;
		filter:
			drop-shadow(0px 0px 60px rgba(38, 199, 230, 0.45))
			drop-shadow(0px 8px 20px rgba(0, 0, 0, 0.8));
	}

	h1 {
		position: relative;
		font-family: "Womprat", sans-serif;
		font-size: 96px;
		font-weight: 700;
		line-height: 1;
		color: var(--yellow);
		z-index: 2;
		filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.9));
	}

	p {
		font-size: 20px;
		font-weight: 400;
		opacity: 0.8;
		max-width: 380px;
		margin-top: 12px;
		line-height: 1.4;
	}
}

.button {
	display: block;
	padding: 18px 28px;
	border-radius: 12px;
	margin: 32px 24px 12px;

	background: linear-gradient(rgb(22, 21, 22), rgb(20, 19, 20));
	box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.15), inset 0 -4px 4px rgba(000, 000, 000, 0.3);
	filter: brightness(1);

	font-size: 22px;

	transition: filter 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.button:hover {
	filter: brightness(1.3);
	box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.15), inset 0 -4px 4px rgba(000, 000, 000, 0.3), 0 0 32px rgba(38, 199, 230, 0.35);
}

.button:active {
	background: radial-gradient(rgba(38, 199, 230, 0.6), rgba(38, 199, 230, 0.1));
}

.button.soon {
	cursor: default;
	opacity: 0.8;

	&:hover {
		filter: brightness(1);
		box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.15), inset 0 -4px 4px rgba(000, 000, 000, 0.3);
	}

	&:active {
		background: linear-gradient(rgb(22, 21, 22), rgb(20, 19, 20));
	}
}

.platforms {
	font-size: 14px;
	font-weight: 400;
	opacity: 0.5;
}

.footer {
	width: 100%;
	font-size: 14px;
	font-weight: 400;
	text-align: center;
	opacity: 0.5;
	padding: 24px;
	padding-bottom: max(24px, env(safe-area-inset-bottom));
	line-height: 2;

	a:hover {
		text-decoration: underline;
	}

	small {
		font-size: 12px;
		opacity: 0.7;
	}
}

@media (max-width: 480px) {
	.hero {
		h1 {
			font-size: 72px;
		}

		p {
			font-size: 18px;
		}

		.appIcon {
			width: 160px;
			transform: translateY(32px);
		}
	}
}

/* ============================================
   Privacy
   ============================================ */

.privacy {
	overflow: auto;
	background: #000;

	main {
		max-width: 640px;
		margin: 0 auto;
		padding: 64px 24px;
	}

	.back-link {
		font-size: 16px;
		opacity: 0.6;
		text-decoration: none;

		&:hover {
			opacity: 1;
		}
	}

	h1 {
		font-family: "Womprat", sans-serif;
		font-size: 48px;
		font-weight: 700;
		color: var(--yellow);
		margin: 32px 0 8px;
	}

	h2 {
		font-size: 22px;
		font-weight: 700;
		margin: 40px 0 12px;
	}

	p, li {
		font-size: 17px;
		font-weight: 400;
		line-height: 1.6;
		opacity: 0.85;
	}

	ul {
		padding-left: 20px;
	}

	li + li {
		margin-top: 12px;
	}

	.updated {
		font-size: 15px;
		opacity: 0.5;
		margin-bottom: 24px;
	}

	p a {
		text-decoration: underline;
	}

	.footer {
		margin-top: 48px;
		padding: 0;
		text-align: left;
	}
}
