/**
 * Nocturne Mobile Menu - full-screen mobile navigation.
 * Scoped under .np-mm. Desktop navigation is never touched.
 */

.np-mm {
	--np-mm-bg: color-mix(in srgb, var(--np-token-bg, #211e34) calc(var(--np-mm-bg-alpha, 0.82) * 100%), transparent);
	--np-mm-logo-width: 200px;
	--np-mm-ink: var(--np-token-ink, #f6f3ee);
	--np-mm-muted: var(--np-token-muted, #a7a1b3);
	--np-mm-line: var(--np-token-line, rgba(246, 243, 238, 0.1));
	--np-mm-accent: var(--np-token-accent, #bd793b);
	--np-mm-accent-soft: var(--np-token-accent-soft, rgba(189, 121, 59, 0.16));
	--np-mm-display: var(--np-token-font-display, "Akira Expanded", "Archivo Black", "Arial Black", system-ui, sans-serif);
	--np-mm-body: var(--np-token-font-body, "Avenir", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif);

	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--np-mm-bg);
	color: var(--np-mm-ink);
	font-family: var(--np-mm-body);
	-webkit-backdrop-filter: blur(calc(var(--np-mm-bg-alpha, 0.82) * 8px));
	backdrop-filter: blur(calc(var(--np-mm-bg-alpha, 0.82) * 8px));
	opacity: 0;
	visibility: hidden;
	transform: translateY(-100%);
	transition:
		transform var(--np-token-motion-duration, 0.42s) var(--np-token-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)),
		opacity calc(var(--np-token-motion-duration, 0.42s) * 0.55) ease,
		visibility 0s linear var(--np-token-motion-duration, 0.42s);
}

.np-mm::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: radial-gradient(120% 70% at 88% 0%, var(--np-mm-accent-soft), transparent 58%);
	opacity: var(--np-mm-bg-alpha, 0.82);
	pointer-events: none;
}

.np-mm.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition:
		transform var(--np-token-motion-duration, 0.42s) var(--np-token-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)),
		opacity calc(var(--np-token-motion-duration, 0.42s) * 0.48) ease;
}

.np-mm__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding:
		calc(1.15rem + env(safe-area-inset-top))
		clamp(1.25rem, 5vw, 2rem)
		calc(1.15rem + env(safe-area-inset-bottom));
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* ---------- Top bar ---------- */

.np-mm__top {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 1.25rem;
}

.np-mm__brand {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	max-width: calc(100% - 64px);
	margin: 0;
	color: var(--np-mm-ink);
	font-family: var(--np-mm-display);
	font-size: 0.66rem;
	font-weight: 400;
	letter-spacing: 0.26em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
}

.np-mm__brand--logo {
	flex: 0 1 auto;
}

.np-mm__logo {
	display: block;
	width: var(--np-mm-logo-width, 200px);
	max-width: 100%;
	height: auto;
	opacity: var(--np-mm-logo-opacity, 1);
	object-position: center;
}

.np-mm--logo-align-left .np-mm__brand {
	margin-right: auto;
}

.np-mm--logo-align-center .np-mm__brand {
	margin-left: auto;
	margin-right: auto;
}

.np-mm--logo-align-right .np-mm__brand {
	margin-left: auto;
}

.np-mm--text-sm .np-mm__label {
	font-size: clamp(1.35rem, 6vw, 2rem);
}

.np-mm--text-md .np-mm__label {
	font-size: clamp(1.5rem, 6.6vw, 2.25rem);
}

.np-mm--text-lg .np-mm__label {
	font-size: clamp(1.75rem, 7.2vw, 2.55rem);
}

.np-mm--text-xl .np-mm__label {
	font-size: clamp(1.95rem, 8vw, 2.9rem);
}
	max-height: 60px;
	object-fit: contain;
}

.np-mm .np-mm__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--np-mm-line) !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--np-mm-ink) !important;
	cursor: pointer;
	touch-action: manipulation;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		transform 0.2s ease;
}

.np-mm .np-mm__close:hover {
	border-color: var(--np-mm-accent) !important;
	background: var(--np-mm-accent-soft) !important;
}

.np-mm__close:active {
	transform: scale(0.94);
}

/* ---------- Menu ---------- */

.np-mm__nav {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	margin-top: clamp(1.5rem, 6vh, 3rem);
}

.np-mm__list,
.np-mm__submenu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.np-mm__list {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	border-top: 1px solid var(--np-mm-line);
}

.np-mm__item {
	position: relative;
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	justify-content: center;
	border-bottom: 1px solid var(--np-mm-line);
	opacity: 0;
	transform: translateY(14px);
	transition:
		opacity 0.35s ease,
		transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: calc(var(--i, 0) * 32ms + 60ms);
}

.np-mm.is-open .np-mm__item {
	opacity: 1;
	transform: translateY(0);
}

.np-mm:not(.is-open) .np-mm__item {
	transition-delay: 0s;
	transition-duration: 0.16s;
}

.np-mm__row {
	display: flex;
	flex: 1 0 auto;
	align-items: stretch;
}

.np-mm__link {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: clamp(0.7rem, 2.6vw, 1rem);
	min-width: 0;
	min-height: clamp(4.1rem, 13.5vw, 5.1rem);
	padding: 0.3rem 0;
	color: var(--np-mm-ink);
	text-decoration: none;
	touch-action: manipulation;
	transition: color 0.2s ease;
}

.np-mm__label {
	min-width: 0;
	font-family: var(--np-mm-display);
	font-size: clamp(1.65rem, 7.2vw, 2.55rem);
	font-weight: 400;
	letter-spacing: 0.01em;
	line-height: 0.96;
	text-transform: uppercase;
}

.np-mm--align-center .np-mm__link {
	justify-content: center;
	text-align: center;
}

.np-mm--align-right .np-mm__link {
	justify-content: flex-end;
	text-align: right;
}

.np-mm__item.is-current > .np-mm__row .np-mm__label {
	color: var(--np-mm-accent);
}

/* ---------- Submenus ---------- */

.np-mm .np-mm__subtoggle {
	position: relative;
	flex: 0 0 46px;
	align-self: center;
	width: 46px;
	height: 46px;
	margin-left: 0.2rem;
	padding: 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--np-mm-muted) !important;
	cursor: pointer;
	touch-action: manipulation;
}

.np-mm .np-mm__subtoggle[aria-expanded="true"] {
	color: var(--np-mm-accent) !important;
}

.np-mm__subtoggle span {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 13px;
	height: 1.5px;
	background: currentColor;
	transform: translate(-50%, -50%);
	transition: transform 0.25s ease;
}

.np-mm__subtoggle span:last-child {
	transform: translate(-50%, -50%) rotate(90deg);
}

.np-mm__subtoggle[aria-expanded="true"] span:last-child {
	transform: translate(-50%, -50%) rotate(0deg);
}

.np-mm__submenu {
	max-height: 0;
	overflow: hidden;
	visibility: hidden;
	transition:
		max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 0.34s;
}

.np-mm__submenu.is-open {
	visibility: visible;
	transition:
		max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s;
}

.np-mm__submenu .np-mm__link {
	min-height: 3.1rem;
	padding-left: calc(1.3rem + var(--d, 1) * 1.15rem);
}

.np-mm__submenu .np-mm__label {
	font-family: var(--np-mm-body);
	font-size: 0.86rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1.3;
}

.np-mm__submenu .np-mm__subtoggle {
	flex-basis: 40px;
	width: 40px;
	height: 40px;
}

/* ---------- Footer ---------- */

.np-mm__foot {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.4rem 1.25rem;
	margin-top: clamp(1.5rem, 5vh, 2.5rem);
	padding-top: 1.25rem;
	border-top: 1px solid var(--np-mm-line);
}

.np-mm__foot a {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	color: var(--np-mm-muted);
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-decoration: none;
	text-transform: uppercase;
	touch-action: manipulation;
	transition: color 0.2s ease;
}

.np-mm__foot a:hover {
	color: var(--np-mm-accent);
}

.np-mm__mail {
	letter-spacing: 0.03em !important;
	text-transform: none !important;
}

/* ---------- Focus ---------- */

.np-mm .np-mm__close:focus-visible,
.np-mm .np-mm__link:focus-visible,
.np-mm .np-mm__subtoggle:focus-visible,
.np-mm .np-mm__foot a:focus-visible {
	outline: 2px solid var(--np-mm-accent) !important;
	outline-offset: 3px !important;
}

/* ---------- Fallback trigger (only when the theme has none) ---------- */

.np-mm__launcher {
	display: none;
}

@media (max-width: 768px) {
	.np-mm__launcher {
		position: fixed;
		top: calc(12px + env(safe-area-inset-top));
		right: 16px;
		z-index: 99998;
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		padding: 0;
		border: 1px solid var(--np-mm-line);
		border-radius: 50%;
		background: rgba(21, 19, 30, 0.9);
		color: var(--np-mm-ink);
		cursor: pointer;
		touch-action: manipulation;
	}

	.np-mm__launcher span {
		display: block;
		width: 18px;
		height: 1.5px;
		background: currentColor;
	}

	.np-mm__launcher span + span {
		margin-top: 4px;
	}
}

/* ---------- Lock the page behind the menu ---------- */

html.np-mm-lock,
html.np-mm-lock body {
	overflow: hidden !important;
	overscroll-behavior: none;
}

html.np-mm-lock body {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
}

/* ---------- Replace the theme's mobile drawer ---------- */

@media (max-width: 768px) {
	html.np-mm-ready .mobile-menu,
	html.np-mm-ready .mobile-menu-overlay,
	html.np-mm-ready .mobile-menu__overlay,
	html.np-mm-ready .mobile-menu-backdrop {
		display: none !important;
	}
}

/* Desktop and print: the plugin is invisible. */

@media (min-width: 769px) {
	.np-mm {
		display: none !important;
	}
}

@media print {
	.np-mm {
		display: none !important;
	}
}

/* Landscape phones: keep the rows compact. */

@media (max-height: 560px) and (orientation: landscape) {
	.np-mm__panel {
		padding-top: calc(0.75rem + env(safe-area-inset-top));
	}

	.np-mm__top {
		padding-bottom: 0.75rem;
	}

	.np-mm__nav {
		margin-top: 1rem;
	}

	.np-mm__link {
		min-height: 3.1rem;
	}

	.np-mm__label {
		font-size: 1.5rem;
	}

	.np-mm__foot {
		margin-top: 1rem;
		padding-top: 0.85rem;
	}
}

/* Respect reduced motion. */

@media (prefers-reduced-motion: reduce) {
	.np-mm,
	.np-mm__item,
	.np-mm__subtoggle span,
	.np-mm__submenu {
		transition: none !important;
	}
}
