/* =================================================================
   GLOBAL.CSS - Reveries Theme
   Reset, CSS variables, typography, body background, scrollbar,
   custom cursor, preloader base styles.
   Loaded on every page via inc/enqueue.php - never duplicated.
================================================================= */

/* =============================================
   CSS VARIABLES - single source of truth
============================================= */
:root {
	/* Backgrounds */
	--bg:          #050505;
	--bg-soft:     #0d0d0d;
	--deep-grey:   #151515;

	/* Text */
	--ink:         #f4f4f4;
	--muted:       #9d9d9d;
	--soft-grey:   #757575;

	/* Lines & Glass */
	--line:        rgba(245, 245, 245, .12);
	--glass:       rgba(5, 5, 5, .58);
	--dim:         #2f2f2f;

	/* Easing */
	--ease:        cubic-bezier(.22, 1, .36, 1);
	--cinema-ease: cubic-bezier(.16, 1, .3, 1);

	/* Nav */
	--nav-height:  112px;
	--nav-x:       clamp(22px, 4vw, 56px);
	--nav-center-y: calc(var(--nav-height) / 2);

	/* Fonts */
	--font-primary: 'Manrope', sans-serif;
	--font-body: var(--font-primary);
	--font-display: var(--font-primary);
	--font-secondary: 'Plus Jakarta Sans', var(--font-primary);
	--font-roboto: 'Roboto', var(--font-primary);
	--font-editor: 'Inter', var(--font-primary);
	--font-serif: 'Cardo', serif;
}

@media (max-width: 991px) {
	:root {
		--nav-height: 82px;
		--nav-x: 22px;
	}
}

@media (max-width: 560px) {
	:root {
		--nav-height: 76px;
	}
}

/* =============================================
   CUSTOM PROPERTY REGISTRATION
============================================= */
@property --light-breath {
	syntax: "<number>";
	inherits: true;
	initial-value: 0;
}

/* =============================================
   RESET
============================================= */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--nav-height);
}

:focus:not(input):not(textarea):not([contenteditable]):not([role="textbox"]),
:focus-visible:not(input):not(textarea):not([contenteditable]):not([role="textbox"]),
:active:not(input):not(textarea):not([contenteditable]):not([role="textbox"]) {
	caret-color: transparent !important;
}

a {
	color: inherit;
}

img {
	max-width: 100%;
	display: block;
}

button {
	font: inherit;
	background: none;
	border: none;
}

a,
button,
input,
textarea,
select,
[role="button"] {
	cursor: pointer;
}

/* =============================================
   TYPOGRAPHY
============================================= */
body {
	font-family: var(--font-primary);
	font-weight: 400;
}

h1, h2, h3, h4, h5, h6,
button,
input,
textarea,
select {
	font-family: var(--font-primary);
}

/* =============================================
   BODY
============================================= */
body {
	min-height: 100vh;
	overflow-x: hidden;
	max-width: 100%;
	background: var(--bg);
	color: var(--ink);
	margin-top: 0 !important;
}

body.menu-open {
	overflow: hidden;
}

html {
	scroll-behavior: smooth;
}

/* =============================================
   SCROLLBAR
============================================= */
html {
	scrollbar-width: thin;
	scrollbar-color: rgba(245, 245, 245, .25) var(--bg);
}

::-webkit-scrollbar {
	width: 9px;
	height: 9px;
}

::-webkit-scrollbar-track {
	background: var(--bg);
}

::-webkit-scrollbar-thumb {
	background: rgba(245, 245, 245, .2);
	border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(245, 245, 245, .38);
}

/* =============================================
   CUSTOM CURSOR
============================================= */
@media (hover: hover) and (pointer: fine) {
	body {
		cursor: auto;
	}
}

.rv-cursor {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 2147483647;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--ink);
	pointer-events: none;
	transform: translate3d(-9999px, -9999px, 0) translate(-50%, -50%);
	mix-blend-mode: difference;
	transition: width .25s var(--ease), height .25s var(--ease), opacity .25s ease, background .25s ease;
	will-change: transform;
}

.rv-cursor.is-hover {
	width: 38px;
	height: 38px;
	background: rgba(245, 245, 245, .65);
}

.rv-cursor.is-hidden {
	opacity: 0;
}

@media (hover: none), (pointer: coarse) {
	.rv-cursor {
		display: none;
	}
}

/* =============================================
   PRELOADER
============================================= */
.rev-preloader {
	position: fixed;
	inset: 0;
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	transition: opacity .9s var(--ease), visibility .9s var(--ease);
}

.rev-preloader.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.rev-preloader-logo {
	width: clamp(160px, 18vw, 260px);
	opacity: 1;
	transform: scale(1);
	transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}

.rev-preloader-logo.is-visible {
	opacity: 1;
	transform: scale(1);
}

.rev-preloader-logo img {
	display: block;
	width: 100%;
	height: auto;
	filter: brightness(1.38) contrast(1.28) grayscale(100%) drop-shadow(0 0 28px rgba(245, 241, 235, .14));
	user-select: none;
}

/* =============================================
   STATIC NAVBAR
============================================= */
.rev-navbar {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	bottom: auto;
	z-index: 1001;
	display: flex;
	align-items: center;
	height: var(--nav-height);
	padding: 0 var(--nav-x);
	background: rgba(0, 0, 0, .96);
	border-bottom: 0;
	pointer-events: auto;
	visibility: visible;
	transform: translate3d(0, 0, 0);
	transition: transform .22s cubic-bezier(.22, 1, .36, 1);
	will-change: transform;
}

.rev-navbar.is-hidden-near-footer {
	pointer-events: none !important;
	transform: translate3d(0, -100%, 0);
}

.rev-navbar::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(245, 245, 245, .72), transparent);
	pointer-events: none;
}

.rev-navbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: clamp(18px, 2.8vw, 34px);
}

.rev-main-logo {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	width: clamp(128px, 12vw, 174px);
	text-decoration: none;
}

.rev-main-logo img {
	display: block;
	width: 100%;
	height: auto;
	filter: brightness(1.38) contrast(1.28) grayscale(100%) drop-shadow(0 0 28px rgba(245, 241, 235, .14));
	user-select: none;
}

.rev-nav-right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: clamp(18px, 2.8vw, 34px);
	min-width: 0;
}

.rev-menu {
	display: flex;
	align-items: center;
	gap: clamp(20px, 2.6vw, 34px);
	list-style: none;
}

.rev-menu li {
	list-style: none;
}

.rev-mobile-contact-item,
.rev-mobile-menu-contact {
	display: none;
}

.rev-menu a {
	position: relative;
	font-family: var(--font-primary);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .08em;
	text-decoration: none;
	text-transform: uppercase;
	color: rgba(245, 245, 245, .9);
	transition: color .35s ease, transform .35s ease;
	white-space: nowrap;
}

.rev-menu a::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: -8px;
	width: 100%;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(245, 245, 245, .72), transparent);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform .45s ease;
}

.rev-menu a:hover,
.rev-menu a:focus-visible {
	color: #fff;
	transform: translateY(-2px);
	outline: none;
}

.rev-menu a:hover::before,
.rev-menu a:focus-visible::before {
	transform: scaleX(1);
}

.rev-contact {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	overflow: hidden;
	padding: 13px 27px;
	border: 1px solid rgba(245, 245, 245, .12);
	border-radius: 100px;
	background: rgba(245, 245, 245, .04);
	color: var(--ink);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .08em;
	text-decoration: none;
	text-transform: uppercase;
	backdrop-filter: blur(10px);
	transition: border-color .35s ease, background .35s ease, transform .35s ease;
	white-space: nowrap;
}

.rev-contact::before {
	content: "";
	position: absolute;
	top: 0;
	left: -130%;
	width: 54%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
	transform: skewX(-18deg);
	transition: left .8s ease;
}

.rev-contact:hover,
.rev-contact:focus-visible {
	border-color: rgba(245, 245, 245, .34);
	background: rgba(245, 245, 245, .08);
	transform: translateY(-2px);
	outline: none;
}

.rev-contact:hover::before,
.rev-contact:focus-visible::before {
	left: 140%;
}

.rev-menu-toggle {
	display: none;
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border: 1px solid rgba(245, 245, 245, .14);
	border-radius: 50%;
	background: rgba(245, 245, 245, .04);
	color: var(--ink);
	cursor: pointer;
}

.rev-menu-toggle span,
.rev-menu-toggle::before,
.rev-menu-toggle::after {
	content: "";
	display: block;
	width: 18px;
	height: 1px;
	margin: 5px auto;
	background: currentColor;
	transition: transform .35s ease, opacity .35s ease;
}

.rev-menu-toggle[aria-expanded="true"] span {
	opacity: 0;
}

.rev-menu-toggle[aria-expanded="true"]::before {
	transform: translateY(6px) rotate(45deg);
}

.rev-menu-toggle[aria-expanded="true"]::after {
	transform: translateY(-6px) rotate(-45deg);
}

.site-main--services {
	padding-top: 0;
	margin-top: 0;
}

@media (max-width: 991px) {
	.rev-main-logo {
		width: clamp(112px, 18vw, 148px);
	}

	.rev-menu-toggle {
		display: block;
	}

	.rev-menu {
		position: fixed;
		top: var(--nav-height);
		left: 0;
		right: 0;
		display: grid;
		gap: 0;
		padding: 18px var(--nav-x) 28px;
		background: rgba(0, 0, 0, .96);
		border-top: 1px solid rgba(245, 245, 245, .08);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-10px);
		transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
	}

	.rev-menu.open {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.rev-mobile-contact-item {
		display: block;
	}

	.rev-menu a {
		display: block;
		padding: 14px 0;
		font-size: 24px;
	}

	body.menu-open .rev-mobile-menu-contact {
		position: fixed;
		top: calc(var(--nav-height) + 298px);
		left: var(--nav-x);
		z-index: 1004;
		display: block;
		font-family: var(--font-primary);
		font-size: 24px;
		font-weight: 500;
		letter-spacing: .08em;
		text-decoration: none;
		text-transform: uppercase;
		color: rgba(245, 245, 245, .9);
		white-space: nowrap;
	}
}

@media (max-width: 560px) {
	.rev-main-logo {
		width: 104px;
	}

	.rev-nav-right {
		gap: 9px;
	}

	.rev-contact {
		width: 42px;
		height: 42px;
		min-height: 42px;
		padding: 0;
		font-size: 0;
		border-radius: 50%;
	}

	.rev-contact::after {
		content: "";
		display: block;
		width: 16px;
		height: 16px;
		background: currentColor;
		-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.62 3.38 2 2 0 0 1 3.6 1.21h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.91 8.81a16 16 0 0 0 6.29 6.29l.96-.96a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
		mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.62 3.38 2 2 0 0 1 3.6 1.21h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.91 8.81a16 16 0 0 0 6.29 6.29l.96-.96a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
		-webkit-mask-size: contain;
		mask-size: contain;
		-webkit-mask-repeat: no-repeat;
		mask-repeat: no-repeat;
		-webkit-mask-position: center;
		mask-position: center;
	}
}

/* =============================================
   REDUCED MOTION
============================================= */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
