/*
	Drawfire website (drawfire.gg)

	Built on "Story" by HTML5 UP (html5up.net, @ajlkn), used under the Creative Commons Attribution 3.0
	licence (html5up.net/license). Story's page model is kept: a #wrapper of stacked sections (banner,
	spotlight, wrapper, gallery, items, actions, button) with its orient-left / orient-right switches and
	its breakpoints. The look is Drawfire's own: pencil and ink on ruled paper.

	Colours are the game's palette (.claude/skills/crosshatch-art): paper, graphite, ink, and red ink
	for the one thing to press. Coloured areas are a faint wash with hatching over it, never a flat block.
*/

/* Fonts (both SIL Open Font Licence 1.1; licence texts sit beside the files) */

@font-face {
	font-family: "Patrick Hand";
	src: url("../fonts/patrick-hand.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Notebook Hand";
	src: url("../fonts/notebook-hand.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Palette and sizes */

:root {
	--paper: #F7F5EC;
	--graphite: #2E2E36;
	--ink: #16161E;
	--red: #C4342E;
	--red-dark: #9E2823;
	--blue: #285CBE;
	--gold: #C8961E;
	--green: #2B7A3B;
	--desk: #42352C;

	--rule: rgba(40, 92, 190, 0.15);
	--margin: rgba(196, 52, 46, 0.32);
	--hatch: rgba(46, 46, 54, 0.5);
	--hatch-faint: rgba(46, 46, 54, 0.13);

	--line: 2rem;
	--sheet: 80rem;
	--inner: 68rem;
	--pad: 4.5rem;
	--gutter: 3.5rem;

	/* A hand-ruled box: each corner has its own curve, so no edge is quite straight. */
	--wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
	--wobble-alt: 15px 225px 15px 255px / 255px 15px 225px 15px;

	--body: "Patrick Hand", "Segoe UI", system-ui, -apple-system, sans-serif;
	--display: "Notebook Hand", "Patrick Hand", "Segoe UI", system-ui, sans-serif;
}

/* Reset */

*, *::before, *::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body, h1, h2, h3, p, ul, figure {
	margin: 0;
}

ul {
	padding: 0;
	list-style: none;
}

img, video {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Page: a dark desk with the sheet lying on it */

body {
	background-color: var(--desk);
	background-image:
		repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.10) 0 2px, transparent 2px 9px),
		repeating-linear-gradient(88deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 23px);
	color: var(--graphite);
	font-family: var(--body);
	font-size: 1.25rem;
	line-height: 1.6;
}

#wrapper {
	position: relative;
	max-width: var(--sheet);
	margin: 0 auto;
	overflow: hidden;
	background-color: var(--paper);
	/* Ruled paper: blue lines, and one red margin line down the left. */
	background-image:
		linear-gradient(90deg, transparent 3rem, var(--margin) 3rem, var(--margin) calc(3rem + 2px), transparent calc(3rem + 2px)),
		repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line));
	box-shadow: 0 0 0 1px rgba(22, 22, 30, 0.35), 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
}

@media (min-width: 84rem) {
	body {
		padding: 2.5rem 0 4rem;
	}
}

/* Type */

h1, h2, h3 {
	color: var(--ink);
	font-family: var(--display);
	font-weight: 400;
	line-height: 1.15;
}

h2 {
	display: inline-block;
	margin-bottom: 1.25rem;
	padding-bottom: 0.7rem;
	background: url("../img/underline.svg") no-repeat left bottom / 100% 0.75rem;
	font-size: 2.3rem;
	letter-spacing: 0.01em;
}

h3 {
	font-size: 1.5rem;
}

p + p {
	margin-top: 1rem;
}

a {
	color: var(--ink);
	text-decoration-color: var(--red);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--red-dark);
}

:focus-visible {
	outline: 3px solid var(--blue);
	outline-offset: 4px;
	border-radius: 4px;
}

.align-center {
	text-align: center;
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -5rem;
	z-index: 10;
	padding: 0.5rem 1rem;
	background: var(--paper);
	border: 3px solid var(--ink);
	border-radius: var(--wobble);
	color: var(--ink);
}

.skip-link:focus {
	top: 1rem;
}

/* Frame: an inked border round a picture, with a cross-hatched shadow behind it */

.frame {
	position: relative;
	isolation: isolate;
}

.frame > img,
.frame > video {
	width: 100%;
	background-color: var(--paper);
	border: 3px solid var(--ink);
	border-radius: var(--wobble);
}

.frame::after {
	content: "";
	position: absolute;
	inset: 0.9rem -0.9rem -0.9rem 0.9rem;
	z-index: -1;
	border-radius: var(--wobble);
	background-image:
		repeating-linear-gradient(135deg, var(--hatch) 0 1.3px, transparent 1.3px 6px),
		repeating-linear-gradient(45deg, rgba(46, 46, 54, 0.22) 0 1px, transparent 1px 8px);
}

.tilt-left {
	transform: rotate(-0.8deg);
}

.tilt-right {
	transform: rotate(0.7deg);
}

/* Button: a marker plate. Hatching shows through the colour, like the game's HUD plates. */

.button {
	display: inline-block;
	padding: 0.55em 1.3em 0.6em;
	border: 3px solid var(--ink);
	border-radius: var(--wobble);
	background-color: var(--paper);
	background-image: repeating-linear-gradient(135deg, var(--hatch-faint) 0 1.2px, transparent 1.2px 6px);
	box-shadow: 4px 5px 0 -1px rgba(22, 22, 30, 0.75);
	color: var(--ink);
	font-family: var(--display);
	font-size: 1.35rem;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button.big {
	font-size: 1.7rem;
}

.button.primary {
	background-color: var(--red);
	background-image:
		repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.13) 0 2px, transparent 2px 7px),
		repeating-linear-gradient(28deg, rgba(22, 22, 30, 0.12) 0 1.2px, transparent 1.2px 9px);
	color: #FFFFFF;
	text-shadow: 0 1px 0 rgba(22, 22, 30, 0.45);
}

.button:hover {
	color: var(--ink);
	transform: translate(-2px, -3px) rotate(-1deg);
	box-shadow: 6px 8px 0 -1px rgba(22, 22, 30, 0.75);
}

.button.primary:hover {
	color: #FFFFFF;
}

.button:active {
	transform: translate(2px, 3px);
	box-shadow: 1px 1px 0 -1px rgba(22, 22, 30, 0.75);
}

/* Stamp: "Totally free", pressed on at an angle in red ink */

.stamp {
	display: inline-block;
	padding: 0.2rem;
	border: 3px solid var(--red);
	border-radius: 0.6rem;
	color: var(--red-dark);
	font-family: var(--display);
	font-size: 1.5rem;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	transform: rotate(-5deg);
	transition: transform 0.15s ease;
}

.stamp span {
	display: block;
	padding: 0.3em 0.9em 0.35em;
	border: 1.5px solid var(--red);
	border-radius: 0.35rem;
	background-image: repeating-linear-gradient(135deg, rgba(196, 52, 46, 0.16) 0 1.2px, transparent 1.2px 5px);
}

.stamp:hover {
	color: var(--red-dark);
	transform: rotate(-2deg) scale(1.04);
}

/* Actions: a row of buttons */

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.25rem 1.75rem;
}

.actions.centred {
	justify-content: center;
}

/* The Steam slot: plain words until config.js turns the button on */

.steam-slot {
	color: var(--graphite);
	font-family: var(--display);
	font-size: 1.3rem;
}

p.steam-slot {
	margin-top: 1.4rem;
}

/* Banner: logo and buttons on the left, the trailer on the right */

.banner {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	grid-template-areas:
		"content trailer"
		"cta     trailer";
	column-gap: var(--gutter);
	align-items: center;
	padding: var(--pad) var(--pad) calc(var(--pad) + 0.5rem) calc(var(--pad) + 1rem);
}

.banner .content {
	grid-area: content;
	align-self: end;
}

.banner .cta {
	grid-area: cta;
	align-self: start;
	margin-top: 1.9rem;
}

.banner .trailer {
	grid-area: trailer;
}

.banner .logo {
	width: 100%;
	max-width: 35rem;
}

.banner .major {
	margin-top: 1.2rem;
	color: var(--ink);
	font-size: 1.6rem;
	line-height: 1.35;
}

/* Trailer */

.trailer video {
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.trailer figcaption {
	margin-top: 1.6rem;
	color: var(--graphite);
	font-size: 1.05rem;
	text-align: right;
}

.play {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--wobble);
	background: none;
	color: var(--ink);
	font-family: var(--display);
	font-size: 1.4rem;
	cursor: pointer;
}

#events[hidden] {
	display: none;
}

.play[hidden] {
	display: none;
}

.play svg {
	width: clamp(4.5rem, 14vw, 7rem);
	height: auto;
	filter: drop-shadow(3px 4px 0 rgba(22, 22, 30, 0.7));
	transition: transform 0.15s ease;
}

.play-disc {
	fill: var(--red);
	stroke: var(--ink);
	stroke-width: 4;
	stroke-linejoin: round;
}

.play-mark {
	fill: #FFFFFF;
	stroke: #FFFFFF;
	stroke-width: 5;
	stroke-linejoin: round;
}

.play span {
	padding: 0.1em 0.7em 0.15em;
	border: 2px solid var(--ink);
	border-radius: var(--wobble);
	background-color: var(--paper);
}

.play:hover svg,
.play:focus-visible svg {
	transform: scale(1.08) rotate(-3deg);
}

/* Wrapper sections */

.wrapper {
	padding: var(--pad);
}

.wrapper > .inner {
	max-width: var(--inner);
	margin: 0 auto;
}

.wrapper.align-center > .inner > p {
	max-width: 44rem;
	margin-left: auto;
	margin-right: auto;
}

.lead {
	color: var(--ink);
	font-size: 1.75rem;
	line-height: 1.45;
}

/* Divided: a pencil line between sections */

.divided > main > section,
.divided > footer {
	position: relative;
}

.divided > main > section::before,
.divided > footer::before {
	content: "";
	position: absolute;
	left: 8%;
	right: 8%;
	top: -0.5rem;
	height: 1rem;
	background: url("../img/rule.svg") no-repeat center / 100% 100%;
}

/* Spotlight: words on one side, a picture on the other */

.spotlight {
	display: flex;
	align-items: center;
	gap: var(--gutter);
	padding: var(--pad) var(--pad) var(--pad) calc(var(--pad) + 1rem);
}

.spotlight .content {
	flex: 0 0 42%;
}

.spotlight .image {
	flex: 1 1 0;
	min-width: 0;
	padding-right: 0.9rem;
}

.spotlight.orient-left {
	flex-direction: row-reverse;
}

/* Gallery */

.gallery {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2rem 1.75rem;
	max-width: var(--inner);
	margin: 1.5rem auto 0;
}

.gallery li {
	flex: 0 1 calc((100% - 3 * 1.75rem) / 4);
	min-width: 0;
}

.gallery a {
	display: block;
	color: var(--ink);
	text-decoration: none;
	transition: transform 0.15s ease;
}

.gallery li:nth-child(odd) a {
	transform: rotate(-0.9deg);
}

.gallery li:nth-child(even) a {
	transform: rotate(0.8deg);
}

.gallery a:hover,
.gallery a:focus-visible {
	transform: rotate(0deg) scale(1.04);
}

.gallery img {
	width: 100%;
	border: 2.5px solid var(--ink);
	border-radius: var(--wobble-alt);
	background-color: var(--paper);
	box-shadow: 5px 6px 0 -1px rgba(46, 46, 54, 0.4);
}

.gallery .caption {
	display: block;
	margin-top: 0.5rem;
	font-family: var(--display);
	font-size: 1.15rem;
}

/* Items: the events, as notes stuck to the page */

.items {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2rem;
	max-width: var(--inner);
	margin: 2.25rem auto 0;
}

.items > li {
	flex: 0 1 20rem;
	padding: 1.3rem 1.5rem 1.5rem;
	border: 2.5px solid var(--ink);
	border-radius: var(--wobble);
	background-color: var(--paper);
	/* A faint gold wash with hatching over it (never a flat block). */
	background-image:
		repeating-linear-gradient(135deg, rgba(46, 46, 54, 0.10) 0 1.2px, transparent 1.2px 7px),
		linear-gradient(rgba(200, 150, 30, 0.22), rgba(200, 150, 30, 0.22));
	box-shadow: 5px 6px 0 -1px rgba(46, 46, 54, 0.4);
	text-align: left;
	line-height: 1.4;
}

.items > li:nth-child(odd) {
	transform: rotate(-1.1deg);
}

.items > li:nth-child(even) {
	transform: rotate(0.9deg);
}

.items > li.past {
	background-image:
		repeating-linear-gradient(135deg, rgba(46, 46, 54, 0.10) 0 1.2px, transparent 1.2px 7px);
}

.items .when {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	color: var(--ink);
	font-family: var(--display);
	font-size: 1.3rem;
}

.items .status {
	color: var(--graphite);
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.items .upcoming .status {
	color: var(--red-dark);
}

.items h3 {
	margin: 0.5rem 0 0.3rem;
	font-size: 1.7rem;
}

.items .place {
	color: var(--ink);
}

/* Closing call to action */

.closing .actions {
	margin-top: 2rem;
}

/* Footer */

.footer {
	padding-top: 3rem;
	padding-bottom: 3rem;
	font-size: 1.1rem;
	text-align: center;
}

.footer .links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 2.5rem;
	font-family: var(--display);
	font-size: 1.3rem;
}

.footer .copyright {
	margin-top: 1.25rem;
}

.footer .credit {
	margin-top: 0.25rem;
	font-size: 1rem;
}

/* Lightbox: the screenshot viewer */

#lightbox {
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 3.5rem 4.5rem 1rem;
	border: 0;
	background: transparent;
	color: var(--paper);
}

#lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

#lightbox::backdrop {
	background-color: rgba(30, 24, 20, 0.96);
}

#lightbox figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-height: 100%;
}

#lightbox img {
	width: auto;
	max-width: 100%;
	max-height: calc(100vh - 9rem);
	border: 3px solid var(--ink);
	border-radius: 6px;
	background-color: var(--paper);
}

#lightbox figcaption {
	min-height: 2rem;
	margin-top: 0.75rem;
	font-size: 1.2rem;
	text-align: center;
}

.lb-button {
	position: absolute;
	display: grid;
	place-items: center;
	width: 3.25rem;
	height: 3.25rem;
	padding: 0 0 0.2rem;
	border: 3px solid var(--ink);
	border-radius: var(--wobble);
	background-color: var(--paper);
	background-image: repeating-linear-gradient(135deg, var(--hatch-faint) 0 1.2px, transparent 1.2px 6px);
	color: var(--ink);
	font-family: var(--body);
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.lb-button:hover {
	background-color: #FFFFFF;
}

.lb-button:focus-visible {
	outline-color: var(--paper);
}

.lb-prev {
	left: 0.6rem;
	top: calc(50% - 1.6rem);
}

.lb-next {
	right: 0.6rem;
	top: calc(50% - 1.6rem);
}

.lb-close {
	right: 0.6rem;
	top: 0.6rem;
}

/* Reveal on scroll (only with scripts on, and only when motion is welcome) */

.js .reveal {
	opacity: 0;
	transform: translateY(1rem);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.js .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.button, .stamp, .gallery a, .play svg {
		transition: none;
	}
}

/* Breakpoints (Story's: large 1280, medium 980, small 736, xsmall 480) */

@media (max-width: 1280px) {
	:root {
		--pad: 3.5rem;
		--gutter: 2.75rem;
	}

	.button.big {
		font-size: 1.5rem;
	}

	.banner .major {
		font-size: 1.45rem;
	}
}

@media (max-width: 980px) {
	:root {
		--pad: 2.75rem;
	}

	/* One column: logo and line, then the trailer, then the buttons. */
	.banner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"content"
			"trailer"
			"cta";
		row-gap: 1.75rem;
		justify-items: center;
		padding: var(--pad);
		text-align: center;
	}

	.banner .content {
		align-self: auto;
	}

	.banner .trailer {
		width: 100%;
		max-width: 44rem;
		padding-right: 0.9rem;
	}

	.banner .cta {
		margin-top: 0.75rem;
	}

	.banner .actions {
		justify-content: center;
	}

	.spotlight,
	.spotlight.orient-left {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 2.25rem;
		padding: var(--pad);
	}

	.spotlight .content {
		flex: none;
	}

	.spotlight .image {
		flex: none;
		width: 100%;
		max-width: 40rem;
		margin: 0 auto;
	}

	.gallery li {
		flex-basis: calc((100% - 1.75rem) / 2);
	}
}

@media (max-width: 736px) {
	:root {
		--pad: 1.5rem;
	}

	body {
		font-size: 1.15rem;
	}

	/* The margin line moves to the edge so it never runs through the words. */
	#wrapper {
		background-image:
			linear-gradient(90deg, transparent 0.6rem, var(--margin) 0.6rem, var(--margin) calc(0.6rem + 1.5px), transparent calc(0.6rem + 1.5px)),
			repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line));
	}

	.banner {
		padding-top: 2rem;
		padding-bottom: 2.5rem;
	}

	.wrapper,
	.spotlight,
	.spotlight.orient-left {
		padding-top: 2.75rem;
		padding-bottom: 2.75rem;
	}

	h2 {
		font-size: 1.85rem;
	}

	.lead {
		font-size: 1.4rem;
	}

	.banner .major {
		margin-top: 0.8rem;
		font-size: 1.3rem;
	}

	.frame::after {
		inset: 0.6rem -0.6rem -0.6rem 0.6rem;
	}

	.banner .trailer,
	.spotlight .image {
		padding-right: 0.6rem;
	}

	.trailer figcaption {
		margin-top: 1.1rem;
		font-size: 0.95rem;
		text-align: center;
	}

	.play {
		font-size: 1.15rem;
	}

	.gallery {
		gap: 1.25rem 1rem;
	}

	.gallery li {
		flex-basis: calc((100% - 1rem) / 2);
	}

	.gallery .caption {
		font-size: 1rem;
	}

	.items {
		gap: 1.5rem;
	}

	.items > li {
		flex-basis: 100%;
	}

	#lightbox {
		padding: 4.5rem 0.5rem 4.5rem;
	}

	#lightbox img {
		max-height: calc(100vh - 13rem);
	}

	.lb-prev,
	.lb-next {
		top: auto;
		bottom: 0.6rem;
	}

	.lb-prev {
		left: calc(50% - 4rem);
	}

	.lb-next {
		right: calc(50% - 4rem);
	}
}

@media (max-width: 480px) {
	.button.big {
		font-size: 1.4rem;
	}

	.stamp {
		font-size: 1.25rem;
	}

	.actions {
		gap: 1.1rem 1.25rem;
	}
}
