/**
 * NX Tools front end.
 *
 * Colours are defined once as tokens on :root and remapped for dark mode, so a
 * rebrand means editing the block at the top of this file and nothing else.
 */

:root {
	--nx-accent: #d7382b;
	--nx-accent-ink: #ffffff;
	--nx-accent-soft: rgba(215, 56, 43, 0.1);

	--nx-ink: #14171a;
	--nx-ink-muted: #5b6570;
	--nx-ink-faint: #8b949e;

	--nx-surface: #ffffff;
	--nx-surface-sunken: #f4f5f7;
	--nx-surface-raised: #ffffff;

	--nx-line: #e3e6ea;
	--nx-line-strong: #cdd3da;

	--nx-radius: 10px;
	--nx-radius-lg: 16px;
	--nx-shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px rgba(16, 24, 32, 0.06);

	--nx-space: 1rem;
	--nx-wrap: 68rem;
	--nx-wrap-narrow: 34rem;

	--nx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--nx-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--nx-accent: #ff5c4d;
		--nx-accent-ink: #1a0d0b;
		--nx-accent-soft: rgba(255, 92, 77, 0.14);

		--nx-ink: #e9edf1;
		--nx-ink-muted: #a3adb8;
		--nx-ink-faint: #78828d;

		--nx-surface: #111417;
		--nx-surface-sunken: #0b0d0f;
		--nx-surface-raised: #191d21;

		--nx-line: #262b31;
		--nx-line-strong: #363d45;

		--nx-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
	}
}

/* --- Base ------------------------------------------------------------- */

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

body {
	margin: 0;
	background: var(--nx-surface-sunken);
	color: var(--nx-ink);
	font-family: var(--nx-font);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--nx-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

h1, h2, h3 {
	line-height: 1.2;
	letter-spacing: -0.015em;
	margin: 0 0 0.4em;
}

code {
	font-family: var(--nx-font-mono);
	font-size: 0.9em;
	background: var(--nx-surface-raised);
	border: 1px solid var(--nx-line);
	border-radius: 5px;
	padding: 0.1em 0.4em;
}

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

.icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

.wrap {
	width: 100%;
	max-width: var(--nx-wrap);
	margin-inline: auto;
	padding-inline: max(1rem, env(safe-area-inset-left));
}

.wrap--narrow {
	max-width: var(--nx-wrap-narrow);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100;
	width: auto;
	height: auto;
	clip-path: none;
	padding: 0.6rem 1rem;
	background: var(--nx-surface-raised);
	border-radius: var(--nx-radius);
	box-shadow: var(--nx-shadow);
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--nx-accent);
	outline-offset: 2px;
}

/* --- Chrome ----------------------------------------------------------- */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1;
	padding-block: clamp(2rem, 6vw, 3.5rem);
}

/* The logo is white, so the header stays dark in either colour scheme. */
.site-header {
	background: #0b0d0f;
	border-bottom: 1px solid #262b31;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 60px;
	padding-block: 12px;
}

.brand {
	font-weight: 650;
	font-size: 1.05rem;
	letter-spacing: -0.02em;
	color: var(--nx-ink);
	text-decoration: none;
}

.site-nav__list,
.site-footer__list {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.925rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}

.brand__logo {
	display: block;
	width: 120px;
	max-width: 100%;
	height: auto;
	opacity: 0.5;
	/* The artwork is black; flatten it to pure white (#fff). */
	filter: brightness(0) invert(1);
}

.site-nav__list a {
	color: #a3adb8;
	text-decoration: none;
}

.site-nav__list a:hover {
	color: #ffffff;
}

.site-footer {
	border-top: 1px solid var(--nx-line);
	background: var(--nx-surface);
	padding-block: 1.5rem;
	font-size: 0.875rem;
	color: var(--nx-ink-muted);
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.site-footer__copyright {
	margin: 0;
}

/* --- Page header ------------------------------------------------------ */

.page-header {
	margin-bottom: 2rem;
}

.page-header__title {
	font-size: clamp(1.6rem, 4vw, 2.25rem);
	margin-bottom: 0.25rem;
}

.page-header__lede {
	margin: 0;
	color: var(--nx-ink-muted);
	font-size: 1.05rem;
}

/* --- Buttons ---------------------------------------------------------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.6rem 1.1rem;
	border: 1px solid var(--nx-line-strong);
	border-radius: var(--nx-radius);
	background: var(--nx-surface-raised);
	color: var(--nx-ink);
	font: inherit;
	font-weight: 550;
	font-size: 0.95rem;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.button:hover {
	border-color: var(--nx-ink-faint);
}

.button:active {
	transform: translateY(1px);
}

.button--primary {
	background: var(--nx-accent);
	border-color: var(--nx-accent);
	color: var(--nx-accent-ink);
}

.button--primary:hover {
	filter: brightness(1.06);
}

/* --- Tool index ------------------------------------------------------- */

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

.tool-card__link {
	display: flex;
	align-items: flex-start;
	gap: 0.9rem;
	height: 100%;
	padding: 1.25rem;
	background: var(--nx-surface-raised);
	border: 1px solid var(--nx-line);
	border-radius: var(--nx-radius-lg);
	color: inherit;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tool-card__link:hover {
	border-color: var(--nx-line-strong);
	box-shadow: var(--nx-shadow);
	transform: translateY(-1px);
}

.tool-card__icon {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	flex: none;
	border-radius: var(--nx-radius);
	background: var(--nx-accent-soft);
	color: var(--nx-accent);
}

.tool-card__icon svg {
	width: 1.35rem;
	height: 1.35rem;
}

.tool-card__body {
	flex: 1;
}

.tool-card__title {
	display: block;
	font-weight: 620;
	margin-bottom: 0.15rem;
}

.tool-card__text {
	display: block;
	color: var(--nx-ink-muted);
	font-size: 0.925rem;
}

.tool-card__arrow {
	color: var(--nx-ink-faint);
	align-self: center;
}

/* --- Directory -------------------------------------------------------- */

.person-card {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--nx-surface-raised);
	border: 1px solid var(--nx-line);
	border-radius: var(--nx-radius-lg);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.person-card:hover {
	border-color: var(--nx-line-strong);
	box-shadow: var(--nx-shadow);
}

.person-card__link {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	flex: 1;
	min-width: 0;
	padding: 0.9rem 1rem;
	color: inherit;
	text-decoration: none;
}

.person-card__body {
	min-width: 0;
}

.person-card__name {
	display: block;
	font-weight: 600;
}

.person-card__role {
	display: block;
	color: var(--nx-ink-muted);
	font-size: 0.875rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.person-card__vcf {
	display: grid;
	place-items: center;
	width: 2.75rem;
	align-self: stretch;
	color: var(--nx-ink-faint);
	border-left: 1px solid var(--nx-line);
}

.person-card__vcf:hover {
	color: var(--nx-accent);
	background: var(--nx-accent-soft);
}

/* --- Portraits -------------------------------------------------------- */

.portrait {
	display: grid;
	place-items: center;
	width: 7rem;
	height: 7rem;
	flex: none;
	overflow: hidden;
	border-radius: 50%;
	background: var(--nx-surface-sunken);
	border: 1px solid var(--nx-line);
}

.portrait--sm {
	width: 3rem;
	height: 3rem;
}

.portrait__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.portrait__initials {
	font-weight: 600;
	font-size: 2rem;
	color: var(--nx-ink-faint);
	letter-spacing: 0.02em;
}

.portrait--sm .portrait__initials {
	font-size: 1rem;
}

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

.vcard {
	background: var(--nx-surface-raised);
	border: 1px solid var(--nx-line);
	border-radius: var(--nx-radius-lg);
	box-shadow: var(--nx-shadow);
	overflow: hidden;
}

.vcard__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.35rem;
	padding: 2rem 1.5rem 1.5rem;
	border-bottom: 1px solid var(--nx-line);
}

.vcard__header .portrait {
	margin-bottom: 0.75rem;
}

.vcard__name {
	font-size: clamp(1.4rem, 5vw, 1.75rem);
	margin: 0;
}

.vcard__subtitle {
	margin: 0;
	color: var(--nx-ink-muted);
	text-wrap: balance;
}

.vcard__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin: 1rem 0 0;
}

.detail-list {
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
}

.detail {
	display: flex;
	align-items: flex-start;
	gap: 0.9rem;
	padding: 0.7rem 1.5rem;
}

.detail + .detail {
	border-top: 1px solid var(--nx-line);
}

.detail__icon {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	flex: none;
	margin-top: 0.1rem;
	border-radius: 50%;
	background: var(--nx-accent-soft);
	color: var(--nx-accent);
}

.detail__icon svg {
	width: 1.05rem;
	height: 1.05rem;
}

.detail__body {
	min-width: 0;
}

.detail__label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--nx-ink-faint);
}

.detail__value {
	color: var(--nx-ink);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.detail__value:hover {
	color: var(--nx-accent);
}

.vcard__note {
	padding: 0.5rem 1.5rem 1.25rem;
	color: var(--nx-ink-muted);
	border-top: 1px solid var(--nx-line);
}

.vcard__note p {
	margin: 0.75rem 0 0;
}

/* --- QR --------------------------------------------------------------- */

.qr {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin: 0;
	padding: 1.25rem 1.5rem;
	border-top: 1px solid var(--nx-line);
	background: var(--nx-surface);
}

.qr__code {
	width: 8rem;
	height: 8rem;
	flex: none;
	padding: 0.4rem;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: var(--nx-radius);
}

.qr__code svg {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 2px;
}

.qr__caption {
	color: var(--nx-ink-muted);
	font-size: 0.925rem;
}

.qr__hint {
	display: flex;
	gap: 0.75rem;
	margin-top: 0.35rem;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.vcard__footnote {
	margin: 1rem 0 0;
	text-align: center;
	color: var(--nx-ink-faint);
	font-size: 0.85rem;
}

/* --- Misc ------------------------------------------------------------- */

.notice-empty {
	padding: 2rem;
	text-align: center;
	color: var(--nx-ink-muted);
	background: var(--nx-surface-raised);
	border: 1px dashed var(--nx-line-strong);
	border-radius: var(--nx-radius-lg);
}

.entry-summary + .entry-summary {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--nx-line);
}

.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-form__input {
	flex: 1;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--nx-line-strong);
	border-radius: var(--nx-radius);
	background: var(--nx-surface-raised);
	color: inherit;
	font: inherit;
}

.pagination {
	margin-top: 2rem;
}

.pagination .page-numbers {
	display: inline-block;
	padding: 0.35rem 0.7rem;
	border-radius: var(--nx-radius);
	text-decoration: none;
}

.pagination .current {
	background: var(--nx-accent);
	color: var(--nx-accent-ink);
}

@media (max-width: 30rem) {
	.qr {
		flex-direction: column;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

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

/* The logo is white, so the home page sits on a dark field in either colour scheme. */
.home .site-main {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0b0d0f;
}

.home .site-main > .wrap {
	display: flex;
	align-items: center;
	justify-content: center;
}

.home-hero {
	display: flex;
	align-items: center;
	justify-content: center;
}

.home-hero__logo {
	margin: 0;
	line-height: 0;
}

.home-hero__logo img {
	display: block;
	width: 100%;
	max-width: 240px;
	height: auto;
	/* The artwork is black; flatten it to white. */
	filter: brightness(0) invert(1);
}
