/*
Theme Name: Funky Monstruos
Theme URI: https://funkymonstruos.com
Author: Funky Monstruos
Author URI: https://funkymonstruos.com
Description: One-screen home page for the Funky Monstruos studio, with a giant pixel title, four service tiles, a large character illustration and a contact card. Inner pages (contact, privacy policy) use the same colors with a dark reading panel. Edit texts, image, links and accent color in Appearance > Customize.
Version: 1.1.5
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: funkymonstruos
*/

:root {
	--fm-red-1: #d24a48;
	--fm-red-2: #c03f40;
	--fm-red-3: #a3333a;
	--fm-red-4: #7e2730;
	--fm-base: #c9433f;
	--fm-plum: #3a1218;
	--fm-blush: #fbe1df;
	--fm-soft: #f0cfcf;
	--fm-white: #ffffff;
	--fm-accent: #f2c53d;
	--fm-accent-ink: #241520;
	--fm-pixel: 'Silkscreen', ui-monospace, 'Courier New', monospace;
	--fm-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--fm-pad-x: clamp(20px, 4vw, 56px);
	--fm-title-size: min(14.5vw, 23vh, 220px);
}

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

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

body {
	margin: 0;
	background: var(--fm-base);
	color: var(--fm-white);
	font-family: var(--fm-sans);
	font-size: 17px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--fm-white);
}

a:hover,
a:focus-visible {
	color: #000000;
}

/* Links on the dark panels keep the accent color, since black would not be visible there. */
.fm-card a:hover,
.fm-card a:focus-visible,
.fm-entry a:hover,
.fm-entry a:focus-visible {
	color: var(--fm-accent);
}

:focus-visible {
	outline: 2px solid var(--fm-accent);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 100;
	width: auto;
	height: auto;
	clip: auto;
	padding: 10px 16px;
	background: var(--fm-plum);
	color: var(--fm-white);
	text-decoration: none;
}

/* ---------- Site header ---------- */

.fm-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.fm-header__name {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-family: var(--fm-pixel);
	font-size: 16px;
	text-decoration: none;
}

.fm-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fm-nav a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
}

.fm-nav a::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
}

.fm-nav .current-menu-item > a::before,
.fm-nav .current_page_item > a::before {
	background: currentColor;
}

/* ---------- Home hero ---------- */

.fm-hero {
	position: relative;
	height: 100vh;
	height: 100svh;
	min-height: 760px;
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(170deg, var(--fm-red-1) 0%, var(--fm-red-2) 40%, var(--fm-red-3) 72%, var(--fm-red-4) 100%);
}

/* Soft glows that drift across the background. They pass behind the character and the title. */
.fm-hero::before,
.fm-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	will-change: transform, opacity;
}

.fm-hero::before {
	background: radial-gradient(32% 40% at var(--fm-gx, 50%) var(--fm-gy, 26%), rgba(246, 160, 150, 0.85) 0%, rgba(246, 160, 150, 0) 100%);
	animation: fm-glow-a 11s ease-in-out infinite alternate;
}

/* Once the mouse moves over the hero, the main glow follows it (assets/js/hero.js). */
.fm-hero.fm-follow::before {
	animation: none;
	transform: none;
	opacity: 1;
}

.fm-hero::after {
	background: radial-gradient(26% 30% at 50% 60%, rgba(246, 160, 150, 0.55) 0%, rgba(246, 160, 150, 0) 100%);
	animation: fm-glow-b 14s ease-in-out infinite alternate;
}

@keyframes fm-glow-a {
	0% {
		transform: translate(-28%, -6%) scale(1);
		opacity: 0.75;
	}
	50% {
		transform: translate(0, 6%) scale(1.25);
		opacity: 1;
	}
	100% {
		transform: translate(26%, -4%) scale(1.05);
		opacity: 0.85;
	}
}

@keyframes fm-glow-b {
	0% {
		transform: translate(30%, 8%) scale(1.15);
		opacity: 0.9;
	}
	100% {
		transform: translate(-32%, 14%) scale(0.9);
		opacity: 0.6;
	}
}

/* On the home page the header line sits behind the character, so it is drawn here instead of on the header. */
.fm-hero .fm-header {
	border-bottom-color: transparent;
}

.fm-hero__line {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	max-width: 1440px;
	margin: 0 auto;
	padding: 24px var(--fm-pad-x) 0;
	pointer-events: none;
}

.fm-hero__line span {
	display: block;
	height: 63px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.fm-hero__brand {
	position: absolute;
	left: clamp(20px, 3.4vw, 52px);
	top: 17%;
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 3vh, 36px);
}

.fm-hero__title {
	margin: 0;
	font-family: var(--fm-pixel);
	font-weight: 700;
	line-height: 0.92;
	white-space: nowrap;
}

.fm-hero__title span {
	display: block;
	font-size: var(--fm-title-size);
	letter-spacing: -0.17em;
}

.fm-services {
	display: grid;
	grid-template-columns: repeat(2, max-content);
	gap: 4px;
	margin: 0 0 0 calc(var(--fm-title-size) * 0.12);
	padding: 0;
	list-style: none;
}

.fm-service {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: clamp(84px, 6vw, 88px);
	aspect-ratio: 1;
	padding: 6px 7px;
	background: var(--fm-white);
	color: var(--fm-plum);
}

.fm-service:nth-child(2),
.fm-service:nth-child(3) {
	background: var(--fm-blush);
}

.fm-service {
	transition: background-color 0.25s ease;
}

.fm-service:hover {
	background: #fcebe9;
}

.fm-service:nth-child(2):hover,
.fm-service:nth-child(3):hover {
	background: #f8cdc9;
}

.fm-service__meta {
	display: flex;
	justify-content: space-between;
	font-family: var(--fm-pixel);
	font-size: 10px;
	line-height: 1.2;
}

.fm-service__abbr {
	font-size: clamp(24px, 2.1vw, 31px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
}

.fm-service__label {
	font-size: 10px;
	font-weight: 500;
	line-height: 1.1;
}

.fm-hero__art {
	position: absolute;
	left: 50%;
	top: -4.5%;
	height: 206%;
	width: auto;
	max-width: none;
	transform: translateX(-47%);
	pointer-events: none;
}

.fm-hero__frame {
	position: absolute;
	inset: 0;
	max-width: 1440px;
	margin: 0 auto;
	padding: 24px var(--fm-pad-x) 20px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	pointer-events: none;
}

.fm-hero__frame > * {
	pointer-events: auto;
}

.fm-hero__spacer {
	flex: 1;
	pointer-events: none !important;
}

.fm-hero__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: flex-end;
	gap: 20px;
}

/* ---------- Contact card ---------- */

.fm-card {
	width: min(100%, 380px);
	padding: 22px 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	background: var(--fm-plum);
	color: var(--fm-white);
}

.fm-card__top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.fm-card__badge {
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--fm-accent);
	color: var(--fm-accent-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
}

.fm-card__label {
	font-size: 15px;
	color: var(--fm-soft);
}

.fm-card__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: underline;
	text-underline-offset: 5px;
	overflow-wrap: anywhere;
}

.fm-card__foot {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 14px;
	color: var(--fm-soft);
}

.fm-card__foot a {
	color: var(--fm-soft);
}

/* ---------- Inner pages ---------- */

.fm-page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: linear-gradient(170deg, var(--fm-red-1) 0%, var(--fm-red-2) 40%, var(--fm-red-3) 72%, var(--fm-red-4) 100%) fixed;
}

.fm-page__inner {
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: 24px var(--fm-pad-x) 0;
}

.fm-main {
	flex: 1;
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: clamp(32px, 6vw, 72px) var(--fm-pad-x);
}

.fm-page-title {
	margin: 0 0 clamp(24px, 4vw, 40px);
	font-family: var(--fm-pixel);
	font-weight: 700;
	font-size: clamp(40px, 8vw, 104px);
	line-height: 0.95;
	letter-spacing: -0.12em;
	overflow-wrap: anywhere;
}

.fm-entry {
	max-width: 760px;
	padding: clamp(24px, 4vw, 44px);
	background: var(--fm-plum);
	color: var(--fm-white);
}

.fm-entry + .fm-entry {
	margin-top: 20px;
}

.fm-entry > :first-child {
	margin-top: 0;
}

.fm-entry > :last-child {
	margin-bottom: 0;
}

.fm-entry h2,
.fm-entry h3,
.fm-entry h4 {
	margin: 1.8em 0 0.5em;
	line-height: 1.2;
}

.fm-entry h2 {
	font-size: 26px;
}

.fm-entry h3 {
	font-size: 21px;
}

.fm-entry p,
.fm-entry ul,
.fm-entry ol {
	margin: 0 0 1.1em;
	text-wrap: pretty;
}

.fm-entry a {
	text-underline-offset: 3px;
}

.fm-entry hr {
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	margin: 2em 0;
}

.fm-entry blockquote {
	margin: 1.5em 0;
	padding-left: 18px;
	border-left: 3px solid var(--fm-accent);
	color: var(--fm-soft);
}

.fm-entry__meta {
	margin-bottom: 1em;
	font-family: var(--fm-pixel);
	font-size: 12px;
	color: var(--fm-soft);
}

.fm-entry__title {
	margin: 0 0 0.4em;
	font-size: 26px;
	line-height: 1.2;
}

.fm-entry__title a {
	text-decoration: none;
}

/* Forms (contact form plugins, comments, search) */

.fm-entry input[type="text"],
.fm-entry input[type="email"],
.fm-entry input[type="url"],
.fm-entry input[type="tel"],
.fm-entry input[type="search"],
.fm-entry input[type="number"],
.fm-entry select,
.fm-entry textarea,
.search-form input[type="search"] {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.06);
	color: var(--fm-white);
	font: inherit;
}

.fm-entry textarea {
	min-height: 160px;
	resize: vertical;
}

.fm-entry input:focus,
.fm-entry select:focus,
.fm-entry textarea:focus {
	border-color: var(--fm-accent);
	outline: none;
}

.fm-entry label {
	display: inline-block;
	margin-bottom: 6px;
	font-weight: 500;
}

.fm-entry button,
.fm-entry input[type="submit"],
.fm-entry .wp-block-button__link,
.search-form button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--fm-accent);
	color: var(--fm-accent-ink);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.fm-entry button:hover,
.fm-entry input[type="submit"]:hover,
.fm-entry .wp-block-button__link:hover {
	background: var(--fm-white);
	color: var(--fm-plum);
}

.search-form {
	display: flex;
	gap: 8px;
}

.fm-pagination {
	max-width: 760px;
	margin-top: 24px;
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

/* Page footer */

.fm-footer {
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 var(--fm-pad-x) 20px;
}

.fm-footer__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
	font-size: 14px;
	color: var(--fm-soft);
}

.fm-footer__row a {
	color: var(--fm-soft);
}

.fm-footer__row a:hover,
.fm-footer__row a:focus-visible {
	color: #000000;
}

/* ---------- Inner pages: columns layout (default) ---------- */

body.fm-inner-columns .fm-page-title {
	text-align: center;
	margin-bottom: clamp(32px, 5vw, 64px);
}

body.fm-inner-columns .fm-layout {
	display: grid;
	grid-template-columns: minmax(0, 680px);
	justify-content: center;
	column-gap: clamp(40px, 6vw, 96px);
	align-items: start;
}

body.fm-inner-columns .fm-layout.has-toc {
	grid-template-columns: 240px minmax(0, 680px);
}

body.fm-inner-columns .fm-entry {
	max-width: none;
	padding: 0;
	background: none;
	font-size: 18px;
	line-height: 1.65;
}

body.fm-inner-columns .fm-entry h2 {
	margin-top: 56px;
	font-size: 30px;
	line-height: 1.15;
	letter-spacing: -0.01em;
	scroll-margin-top: 24px;
}

body.fm-inner-columns .fm-entry h3 {
	font-size: 19px;
	color: var(--fm-blush);
}

body.fm-inner-columns .fm-entry > p:first-child > em:only-child,
body.fm-inner-columns .fm-entry__meta {
	font-style: normal;
	font-family: var(--fm-pixel);
	font-size: 12px;
	text-transform: uppercase;
	opacity: 0.85;
}

body.fm-inner-columns .fm-entry a:hover,
body.fm-inner-columns .fm-entry a:focus-visible {
	color: #000000;
}

body.fm-inner-columns .fm-entry .wp-block-button__link:hover,
body.fm-inner-columns .fm-entry button:hover {
	color: var(--fm-plum);
}

body.fm-inner-columns .fm-entry + .fm-entry {
	margin-top: 0;
	padding-top: 28px;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}

body.fm-inner-columns .fm-list > .fm-entry {
	padding-bottom: 28px;
}

body.fm-inner-columns .fm-pagination {
	max-width: none;
}

.fm-toc {
	position: sticky;
	top: 24px;
	font-family: var(--fm-pixel);
	font-size: 12px;
	line-height: 1.45;
	text-transform: uppercase;
}

.fm-toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.fm-toc a {
	display: flex;
	gap: 12px;
	padding: 9px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.25);
	text-decoration: none;
}

.fm-toc a span {
	flex: none;
	opacity: 0.6;
}

.fm-toc a:hover span,
.fm-toc a:focus-visible span {
	opacity: 1;
}

.fm-toc a[aria-current="true"] {
	color: var(--fm-plum);
	background: var(--fm-white);
	padding-left: 8px;
	padding-right: 8px;
}

.fm-toc a[aria-current="true"] span {
	opacity: 1;
}

/* Panel layout (version 1.0) keeps the title on the left. */
body.fm-inner-panel .fm-layout {
	display: block;
}

@media (max-width: 900px) {
	body.fm-inner-columns .fm-layout.has-toc {
		grid-template-columns: minmax(0, 680px);
	}

	.fm-toc {
		display: none;
	}
}

@media (max-width: 720px) {
	body.fm-inner-columns .fm-entry {
		font-size: 17px;
	}

	body.fm-inner-columns .fm-entry h2 {
		margin-top: 44px;
		font-size: 25px;
	}
}

/* WordPress core classes */

.alignleft {
	float: left;
	margin: 0 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: 0 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption-text,
.wp-element-caption {
	font-size: 14px;
	color: var(--fm-soft);
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
	:root {
		--fm-title-size: min(12.4vw, 23vh, 220px);
	}

	.fm-hero {
		min-height: 680px;
	}

	.fm-hero__brand {
		top: 120px;
	}

	.fm-hero__line {
		display: none;
	}

	.fm-hero .fm-header {
		border-bottom-color: rgba(255, 255, 255, 0.3);
	}

	.fm-hero__art {
		left: auto;
		right: -18%;
		top: auto;
		bottom: -38%;
		height: 92%;
		transform: none;
	}

	.fm-card {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
	}

	.fm-hero::before,
	.fm-hero::after {
		animation: none;
	}

	/* The glow that follows the mouse stays on: it only moves when the visitor moves. */
	.fm-hero.fm-follow::before {
		opacity: 1;
	}
}
