/**
 * epasplugins.com — the whole stylesheet.
 *
 * Tokens come from assets-src/palette.md (the EPAS brandbook): navy, blue,
 * the muted blues, ice, line, body and gray, plus the 18px radius. Type roles:
 * Comfortaa for display, Nunito Sans for text, and the system mono stack for
 * the plugin-header data blocks that structure the site.
 *
 * No JavaScript anywhere. Light and dark themes; motion only on hover, and
 * disabled entirely when the visitor asks for less.
 */

/* ---------- fonts ---------- */

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

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

@font-face {
	font-family: 'Nunito Sans';
	src: url('fonts/nunito-sans-600.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Nunito Sans';
	src: url('fonts/nunito-sans-700.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ---------- tokens ---------- */

:root {
	--navy: #0b2545;
	--blue: #2d7ff9;
	--mblue: #7fa8e8;
	--lblue: #afc6e9;
	--sky: #dceafe;
	--ice: #f6f8fb;
	--line: #e3e8ef;
	--body: #33414f;
	--gray: #5f6c7b;

	--accent: var(--blue);

	--bg: var(--ice);
	--surface: #ffffff;
	--surface-2: var(--sky);
	--text: var(--body);
	--heading: var(--navy);
	--muted: var(--gray);
	--border: var(--line);
	--spec-bg: var(--navy);
	--spec-edge: var(--navy);
	--spec-text: var(--sky);
	--spec-label: var(--mblue);
	--spec-line: rgba(175, 198, 233, 0.22);

	--font-display: 'Comfortaa', 'Trebuchet MS', sans-serif;
	--font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

	--radius: 18px;
	--radius-sm: 10px;
	--measure: 68ch;
	--page: 1120px;
	--step: 1.5rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #061627;
		--surface: #0d2038;
		--surface-2: #12294a;
		--text: #d6e2f2;
		--heading: #ffffff;
		--muted: #9db2ce;
		--border: #1d3a5c;
		--spec-bg: #041022;
		--spec-edge: #24456b;
		--spec-text: var(--sky);
		--spec-label: var(--mblue);
		--spec-line: rgba(175, 198, 233, 0.16);
	}
}

/* ---------- reset-ish ---------- */

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 clamp(1rem, 0.97rem + 0.15vw, 1.0625rem) / 1.65 var(--font-body);
	text-rendering: optimizeLegibility;
}

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

a {
	color: color-mix(in srgb, var(--accent) 88%, var(--heading));
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-thickness: 2px;
}

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

code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	background: var(--surface-2);
	border-radius: 4px;
	padding: 0.1em 0.35em;
}

h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 400;
	color: var(--heading);
	letter-spacing: -0.01em;
	line-height: 1.15;
	margin: 0;
	text-wrap: balance;
}

h1 {
	font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

h2 {
	font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

h3 {
	font-size: 1.1875rem;
}

p {
	margin: 0 0 1em;
	max-width: var(--measure);
}

/* ---------- skip link ---------- */

.skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10;
	background: var(--surface);
	color: var(--heading);
	padding: 0.75rem 1rem;
	border: 1px solid var(--border);
	border-radius: 0 0 var(--radius-sm) 0;
}

.skip:focus {
	left: 0;
}

/* ---------- shell ---------- */

.wrap {
	width: 100%;
	max-width: var(--page);
	margin-inline: auto;
	padding-inline: clamp(1.125rem, 4vw, 2.5rem);
}

.site-head {
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}

.site-head__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 2rem;
	padding-block: 1.125rem;
}

.wordmark {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	font-family: var(--font-display);
	font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
	color: var(--heading);
	text-decoration: none;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.wordmark img {
	width: 30px;
	height: 30px;
	border-radius: 7px;
	flex: none;
}

.wordmark__text i {
	font-style: normal;
	color: var(--blue);
}

/* ---------- navigation, with a JavaScript-free mobile toggle ---------- */

.nav-toggle {
	/* Focusable but invisible: it is the state for the label below. */
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.nav-toggle__button {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg);
	cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: var(--heading);
}

.nav-toggle__bars {
	position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
	content: '';
	position: absolute;
	left: 0;
}

.nav-toggle__bars::before {
	top: -6px;
}

.nav-toggle__bars::after {
	top: 6px;
}

.nav-toggle:focus-visible + .nav-toggle__button {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1.5rem;
	font-size: 0.9375rem;
}

.nav a {
	color: var(--text);
	text-decoration: none;
	padding-block: 0.25rem;
	border-bottom: 2px solid transparent;
}

.nav a:hover {
	border-bottom-color: var(--border);
}

.nav a[aria-current='page'] {
	color: var(--heading);
	font-weight: 600;
	border-bottom-color: var(--accent);
}

/* The mobile and desktop overrides come last so they win over the base rules
   above without needing !important. */

@media (max-width: 47.99rem) {
	.nav {
		/* Closed by default on small screens; the checkbox opens it. */
		display: none;
		flex-basis: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		margin-top: 0.75rem;
		border-top: 1px solid var(--border);
	}

	.nav-toggle:checked ~ .nav {
		display: flex;
	}

	.nav a {
		padding-block: 0.875rem;
		padding-inline: 0.125rem;
		border-bottom: 1px solid var(--border);
	}

	.nav a:last-child {
		border-bottom: 0;
	}

	.nav a[aria-current='page'] {
		border-bottom-color: var(--border);
		box-shadow: inset 3px 0 0 var(--accent);
		padding-left: 0.75rem;
	}
}

@media (min-width: 48rem) {
	.nav-toggle,
	.nav-toggle__button {
		display: none;
	}

	.nav {
		margin-left: auto;
	}
}

main {
	display: block;
}

section {
	padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

section + section {
	border-top: 1px solid var(--border);
}

.lede {
	font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
	color: var(--text);
	max-width: 60ch;
}

.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0 0 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.eyebrow::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
	flex: none;
}

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

.hero {
	padding-block: clamp(2.75rem, 6vw, 5.5rem);
}

.hero__grid {
	display: grid;
	gap: clamp(2rem, 4vw, 3.5rem);
	align-items: start;
}

@media (min-width: 60rem) {
	.hero__grid {
		grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr);
	}
}

.hero h1 {
	margin-bottom: 1.25rem;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

.button {
	display: inline-block;
	font: 600 0.9375rem/1 var(--font-body);
	padding: 0.8125rem 1.25rem;
	border-radius: var(--radius-sm);
	text-decoration: none;
	border: 1px solid transparent;
	transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.button--primary {
	background: var(--blue);
	color: #fff;
}

.button--primary:hover {
	background: color-mix(in srgb, var(--blue) 86%, #000);
	transform: translateY(-1px);
}

.button--ghost {
	border-color: var(--border);
	color: var(--heading);
	background: var(--surface);
}

.button--ghost:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

/* ---------- the spec block: a plugin header, used as a data table ---------- */

.spec {
	position: relative;
	margin: 0;
	background: var(--spec-bg);
	color: var(--spec-text);
	border: 1px solid var(--spec-edge);
	border-radius: var(--radius);
	padding: clamp(1.25rem, 3vw, 1.875rem);
	overflow: hidden;
	font-family: var(--font-mono);
	font-size: 0.875rem;
	line-height: 1.7;
}

.spec::after {
	/* The dot-grid motif from the plugin banners — hero only, once. */
	content: '';
	position: absolute;
	inset: 0 0 auto auto;
	width: 46%;
	height: 100%;
	background-image: radial-gradient(var(--spec-line) 1.5px, transparent 1.6px);
	background-size: 18px 18px;
	opacity: 0.9;
	pointer-events: none;
}

.spec > * {
	position: relative;
	z-index: 1;
}

.spec__open,
.spec__close {
	color: var(--spec-label);
	margin: 0;
}

.spec__title {
	font-family: var(--font-mono);
	font-size: 0.875rem;
	font-weight: 400;
	color: #fff;
	letter-spacing: 0;
	margin: 0 0 0.5rem;
}

.spec__title::before {
	content: '* ';
	color: var(--spec-label);
}

.spec dl {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr);
	gap: 0.15rem 1rem;
	margin: 0;
}

.spec dt {
	color: var(--spec-label);
}

.spec dt::before {
	content: '* ';
	opacity: 0.7;
}

.spec dd {
	margin: 0;
	color: #fff;
}

.spec dd.is-none {
	color: var(--mblue);
}

@media (max-width: 30rem) {
	/* Keep the two-column header block readable on small phones. */
	.spec {
		font-size: 0.8125rem;
		padding: 1.125rem;
	}

	.spec dl {
		gap: 0.15rem 0.625rem;
	}

	.spec dd {
		overflow-wrap: anywhere;
	}

	.spec::after {
		width: 32%;
	}
}

/* ---------- cards ---------- */

.grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
	margin-top: 2rem;
	padding: 0;
	list-style: none;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.375rem 1.375rem 1.5rem;
	transition: transform 120ms ease, border-color 120ms ease;
}

.card--link:hover {
	transform: translateY(-2px);
	border-color: var(--accent);
}

.card__dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--accent);
	flex: none;
}

.card h3 {
	font-size: 1.0625rem;
	line-height: 1.3;
}

.card h3 a {
	color: inherit;
	text-decoration: none;
}

.card h3 a::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: var(--radius);
}

.card p {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--text);
}

.card__foot {
	margin-top: auto;
	padding-top: 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--muted);
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.3rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	color: var(--muted);
	background: var(--bg);
}

.chip--released {
	color: color-mix(in srgb, var(--accent) 70%, var(--heading));
	border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
	background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

/* ---------- principle list ---------- */

.principles {
	display: grid;
	gap: 1.5rem 2.5rem;
	margin-top: 2rem;
	padding: 0;
	list-style: none;
}

@media (min-width: 48rem) {
	.principles {
		grid-template-columns: 1fr 1fr;
	}
}

.principles h3 {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 0.375rem;
}

.principles h3::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
	flex: none;
	transform: translateY(-1px);
}

.principles p {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--text);
}

/* ---------- prose blocks ---------- */

.prose h2 {
	margin-top: 2.5rem;
	margin-bottom: 0.75rem;
}

.prose h2:first-child {
	margin-top: 0;
}

.prose ul {
	margin: 0 0 1.25rem;
	padding-left: 0;
	list-style: none;
	max-width: var(--measure);
}

.prose ul li {
	position: relative;
	padding-left: 1.5rem;
	margin-bottom: 0.625rem;
}

.prose ul li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.6em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
}

.faq {
	margin-top: 2rem;
	border-top: 1px solid var(--border);
	max-width: var(--measure);
}

.faq__item {
	border-bottom: 1px solid var(--border);
	padding-block: 1.125rem;
}

.faq__item h3 {
	margin-bottom: 0.375rem;
}

.faq__item p {
	margin: 0;
	color: var(--text);
}

/* ---------- plugin page head ---------- */

.plugin-head {
	display: grid;
	gap: clamp(2rem, 4vw, 3rem);
	align-items: start;
}

@media (min-width: 60rem) {
	.plugin-head {
		grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.8fr);
	}
}

.plugin-head__icon {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	margin-bottom: 1.25rem;
	display: block;
}

.plugin-head h1 {
	margin-bottom: 1rem;
}

.plugin-head h1::after {
	content: '';
	display: block;
	width: 3.5rem;
	height: 4px;
	border-radius: 2px;
	background: var(--accent);
	margin-top: 1rem;
}

.backlink {
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	color: var(--muted);
	text-decoration: none;
	display: inline-block;
	margin-bottom: 1.5rem;
}

.backlink:hover {
	color: var(--heading);
}

.backlink::before {
	content: '← ';
}

/* ---------- callout ---------- */

.callout {
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius-sm);
	padding: 1.25rem 1.375rem;
	max-width: var(--measure);
}

.callout h2,
.callout h3 {
	margin-bottom: 0.5rem;
}

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

.callout__mail {
	font-family: var(--font-mono);
	font-size: 0.9375rem;
}

.callout--spaced {
	margin-top: 2.5rem;
}

/* ---------- utilities ---------- */

.section-heading {
	margin-top: 2.75rem;
}

.section-heading:first-of-type {
	margin-top: 2.5rem;
}

/* ---------- footer ---------- */

.site-foot {
	border-top: 1px solid var(--border);
	background: var(--surface);
	padding-block: 2.25rem;
	font-size: 0.875rem;
	color: var(--muted);
}

.site-foot__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2.5rem;
	align-items: flex-start;
	justify-content: space-between;
}

.site-foot p {
	margin: 0 0 0.35rem;
	max-width: 46ch;
}

.site-foot a {
	color: var(--text);
}

.site-foot__meta {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	line-height: 1.8;
}

/* ---------- motion ---------- */

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

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
