/* ============================================================
   Domus — header  [domus_header]
   Figma: Component 50 (menu box 580×449) + Component 51 (contact 216×227) on desktop,
   "Menu" instance 823:4904 (343×581) on mobile. Measurements are taken from those nodes.

   Root classes
     .dm-header--dark   dark elements (black logo, black contact button) — for light backgrounds
     .dm-header--light  light elements (white logo, white contact button) — for dark backgrounds
     .dm-header--home   "Available in <city>" ticker instead of the logo (desktop)
     .dm-header--sticky fixed to the viewport (default: absolute, scrolls away with the first screen)
     .dm-header--hide   with sticky: slides away on scroll down, back on scroll up
     data-adapt="auto"  theme follows what is behind the bar (JS)
   The menu bar itself is always translucent black with white text.
   ============================================================ */

.dm-header {
	--dm-ease: ease-out;
	--dm-dur: .55s;
	--dm-logo-h: 20px;

	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	margin: 0;
	padding: 0;
	font-family: var(--dm-font, 'CF ModGrotesk'), 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-weight: 400;
	font-size: 13px;
	line-height: 1;
	letter-spacing: 0;
	--dm-ink: #000;          /* theme ink: black elements (dark theme) … */
	color: var(--dm-ink);    /* … inherited by the logo link (links are forced to inherit) */
	transition: color .3s;
	-webkit-font-smoothing: antialiased;
	pointer-events: none; /* only the boxes catch the pointer; the page under the header stays usable */
}
.dm-header--light { --dm-ink: #fff; } /* … white elements (light theme), for dark pages */

/* Figma prototype: SMART_ANIMATE, easing "SLOW" — a near-critically-damped spring, no overshoot. */
@supports (transition-timing-function: linear(0, 1)) {
	.dm-header {
		--dm-ease: linear(0, 0.0095, 0.0348, 0.0721, 0.118, 0.1697, 0.2252, 0.2825, 0.3403, 0.3974, 0.4529, 0.5062, 0.5568, 0.6045, 0.649, 0.6903, 0.7282, 0.763, 0.7946, 0.8232, 0.8489, 0.872, 0.8926, 0.9109, 0.927, 0.9412, 0.9537, 0.9645, 0.9739, 0.982, 0.989, 0.9949, 1);
	}
}

/* Element resets. Elementor's kit styles every bare <a>, <button> and <p> (".elementor-kit-N button",
   ":hover" too), so these are deliberately strong; the few component rules that set the same
   properties use ".dm-header .dm-header__x" (or !important where the reset does). */
.dm-header *,
.dm-header *::before,
.dm-header *::after { box-sizing: border-box; }
.dm-header a {
	color: inherit !important;
	text-decoration: none !important;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-weight: inherit !important;
	letter-spacing: inherit !important;
	outline: none;
	transition: none;
}
.dm-header button {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
	color: inherit !important;
	font-family: inherit !important;
	font-weight: inherit !important;
	font-style: normal !important;
	font-size: inherit;
	line-height: inherit;
	letter-spacing: inherit !important;
	text-transform: inherit;
	text-shadow: none !important;
	min-height: 0 !important;
	min-width: 0 !important;
	width: auto;
	cursor: pointer;
	outline: none;
	transition: none;
}
/* State variants carry ONLY what themes change on hover/focus (colours, borders, decoration), never layout
   or typography — those come from the component rules below, which the states must not outrank. */
.dm-header a:hover,
.dm-header a:focus,
.dm-header a:active,
.dm-header a:visited,
.dm-header button:hover,
.dm-header button:focus,
.dm-header button:active {
	color: inherit !important;
	text-decoration: none !important;
	background: none !important;
	border-color: transparent !important;
	box-shadow: none !important;
	outline: none;
}
.dm-header a:focus-visible,
.dm-header button:focus-visible { outline: 1px solid currentColor !important; outline-offset: -3px; }
.dm-header svg { display: block; flex: none; }
.dm-header p { margin: 0 !important; padding: 0 !important; }
.dm-header ul { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.dm-header li { margin: 0; }

.dm-header--sticky { position: fixed; }
.dm-header--hide { transition: transform .5s var(--dm-ease); }
.dm-header--hide.is-hidden { transform: translateY(-120%); }

.dm-header__inner {
	max-width: calc(var(--dm-max) + var(--dm-side) * 2); /* like an Elementor boxed container: --dm-max of content + the gutters outside it */
	margin: 0 auto;
	padding: 18px var(--dm-side) 0;
}
.dm-header__row { display: flex; align-items: flex-start; }

.dm-header__logo,
.dm-header__available,
.dm-header__menu,
.dm-header__contact { pointer-events: auto; }

/* ---------- Logo (wordmark 216×20 at y=27, the bars start at y=18) ---------- */
.dm-header__logo {
	display: flex;
	align-items: center;
	gap: 9px;
	height: var(--dm-logo-h);
	margin-top: 9px;
	transition: color .3s;
}
.dm-header__logo svg,
.dm-header__logo img { height: 100%; width: auto; }

/* ---------- Home: "Available in" + city ticker (x=32 / x=120). 28px line box centred on the bar (18 + 35/2). ---------- */
.dm-header .dm-header__available {
	display: none;
	align-items: center;
	gap: 3px;
	margin-top: 3.5px !important;
	font-size: 14px;
	line-height: 28px;
	letter-spacing: -.02em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--dm-ink);
	transition: color .3s;
}
.dm-header--home .dm-header__available { display: flex; }
.dm-header--home .dm-header__logo { display: none; }

/* The cities share one grid cell and slide through a 28px window, so the box never resizes. */
.dm-header__cities { display: inline-grid; height: 28px; clip-path: inset(0 -.2em); }
.dm-header__cities > span {
	grid-area: 1 / 1;
	transform: translateY(110%);
	animation: dm-city var(--dm-city-cycle, 5.1s) cubic-bezier(.65, 0, .35, 1) infinite both;
}
/* Negative delays: the first city is already in view on load (no empty window while the page settles). */
.dm-header__cities > span:nth-child(1) { animation-delay: calc(var(--dm-city-cycle, 5.1s) * -0.0784); }
.dm-header__cities > span:nth-child(2) { animation-delay: calc(var(--dm-city-cycle, 5.1s) * (1 / 3 - 0.0784)); }
.dm-header__cities > span:nth-child(3) { animation-delay: calc(var(--dm-city-cycle, 5.1s) * (2 / 3 - 0.0784)); }
.dm-header__cities > span:only-child { animation: none; transform: none; }
@keyframes dm-city {
	0%     { transform: translateY(110%); }
	7.84%  { transform: translateY(0); }
	33.33% { transform: translateY(0); }
	41.18% { transform: translateY(-110%); }
	100%   { transform: translateY(-110%); }
}

/* ---------- Menu box: 580 wide, the bar (35) + a drawer that opens to the panel's height.
   With "Company" expanded the box is 580×449 as in Figma; other rows give other heights. ---------- */
.dm-header__menu {
	position: relative;
	width: 580px;
	margin-left: auto;
	overflow: hidden;
	background: rgba(0, 0, 0, .6);
	-webkit-backdrop-filter: blur(7.5px);
	backdrop-filter: blur(7.5px);
	color: #fff;
}
.dm-header--light .dm-header__menu { background: rgba(37, 37, 37, .6); } /* Figma: contact page bar */

/* The drawer and the accordion bodies animate between explicit pixel heights measured by header.js
   (works the same in every browser; no grid / auto-height tricks). Without JS they are simply open/closed. */
.dm-header__drawer {
	height: 0;
	overflow: hidden;
	transition: height var(--dm-dur) var(--dm-ease);
}
html:not(.dm-js) .dm-header__menu.is-open .dm-header__drawer { height: auto; }
.dm-header__menu.is-resizing .dm-header__drawer,
.dm-header__menu.is-resizing .dm-header__sub { transition: none; }

.dm-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 35px;
	padding: 0 14px;
	text-transform: uppercase;
}
.dm-header__bar { cursor: pointer; } /* the whole bar toggles the menu (JS) */
.dm-header__tools { display: flex; align-items: center; gap: 21px; }
/* Language switcher: a 12px safe area all round that does not toggle the menu (padding + negative margin keeps the layout) */
.dm-header__lang { position: relative; z-index: 1; padding: 12px; margin: -12px; letter-spacing: -.02em; }
.dm-header .dm-header__burger { line-height: 0; }
.dm-header__burger svg { width: 44.5px; height: 7px; }
.dm-header__burger path { transition: transform var(--dm-dur) var(--dm-ease); }
/* Open: the two bars meet on their centre line (Figma shows a single rule). */
.dm-header__menu.is-open .dm-header__burger path:first-child { transform: translateY(3px); }
.dm-header__menu.is-open .dm-header__burger path:last-child { transform: translateY(-3px); }

/* ---------- Panel contents (first row at y=45, x=46, width 487; 69px under the last rule) ---------- */
.dm-header__panel {
	visibility: hidden;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .13s ease, transform var(--dm-dur) var(--dm-ease), visibility 0s var(--dm-dur);
}
.dm-header__menu.is-open .dm-header__panel {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity .22s ease .2s, transform var(--dm-dur) var(--dm-ease) .11s, visibility 0s;
}
.dm-header__panel-in { padding: 10px 47px 69px 46px; }

.dm-header__nav { list-style: none; }
.dm-header__item {
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .3); /* Figma .5px hairline; 1px at 30% reads the same and keeps the maths exact */
}
.dm-header__item:first-child { padding-top: 0; }
.dm-header .dm-header__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 20px;
	font-size: 16px;
	line-height: 1;
	text-align: left;
	text-transform: none;
}
.dm-header__link svg { width: 10.2px; height: 10.2px; }

/* Accordion rows: the arrow flips down while the row is open; the body animates 0fr → 1fr */
.dm-header__item--acc .dm-header__link svg { transition: transform var(--dm-dur) var(--dm-ease); }
.dm-header__item--acc.is-expanded .dm-header__link svg { transform: scaleY(-1); }
.dm-header__sub {
	height: 0;
	overflow: hidden;
	transition: height var(--dm-dur) var(--dm-ease);
}
html:not(.dm-js) .dm-header__item--acc.is-expanded .dm-header__sub { height: auto; }

/* Three 115×144 cards, 7px apart, flush right (y=153 → 297, rule at 306) */
.dm-header__cards {
	display: flex;
	justify-content: flex-end;
	gap: 7px;
	padding: 14px 0 1px; /* + the row's own 8px = 9px to the rule */
}
.dm-header__card {
	position: relative;
	width: 115px;
	height: 144px;
	overflow: hidden;
	color: #fff;
}
.dm-header .dm-header__card img { display: block; width: 100% !important; max-width: none !important; height: 100% !important; object-fit: cover; } /* outranks .elementor img */
.dm-header__card::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .4); }
.dm-header__card--dim::before { background: rgba(0, 0, 0, .64); }
/* Hover: 45,45,45 at 40% over a blur. Only opacity animates (backdrop-filter transitions are patchy). */
.dm-header__card::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(45, 45, 45, .4);
	-webkit-backdrop-filter: blur(25px);
	backdrop-filter: blur(25px);
	opacity: 0;
	transition: opacity var(--dm-dur) var(--dm-ease);
}
.dm-header__card:hover::after,
.dm-header__card:focus-visible::after { opacity: 1; }
/* Label + arrow flow as text, so a long title wraps and the arrow stays on its last line */
.dm-header__card-foot {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 5px;
	z-index: 1;
	display: block;
	font-size: 12px;
	line-height: 12px;
	text-align: right;
}
.dm-header__card-foot svg { display: inline-block; width: 8px; height: 6px; margin-left: 4px; vertical-align: 0; }

/* "View all" (Properties, Our Work, Services): 12px caps, underlined, only while the row is open.
   Desktop: left, level with the card captions. Tablet / mobile: in the row header, left of the arrow.
   The underline is a line (::after): the link reset above takes text-decoration and borders away on purpose. */
.dm-header__item--acc { position: relative; }
.dm-header .dm-header__all {
	position: absolute;
	left: 0;
	bottom: 14px; /* row padding 8 + cards' 1 + the captions' 5 */
	z-index: 1;
	display: block;
	font-size: 12px;
	line-height: 12px;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity .2s ease, transform .3s ease, visibility 0s .3s;
}
.dm-header__all::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform-origin: left; transition: transform .35s var(--dm-ease); }
.dm-header__item--acc.is-expanded .dm-header__all { opacity: 1; visibility: visible; transform: none; transition: opacity .3s ease .15s, transform .4s var(--dm-ease) .15s, visibility 0s; }
@media (hover: hover) { .dm-header .dm-header__all:hover::after { transform: scaleX(.35); } }
@media (max-width: 1024px) {
	.dm-header .dm-header__all { top: 16px; bottom: auto; left: auto; right: 30px; } /* row padding 12, centred on the 20px title line */
	.dm-header__item--acc:first-child .dm-header__all { top: 4px; } /* the first row has no top padding */
}

/* Phone / email inside the panel: mobile only */
.dm-header__panel-contact { display: none; }

/* ---------- Contact box: 216×35 closed, 216×227 open. Black on dark elements, white on light elements. ---------- */
.dm-header__contact {
	position: relative;
	width: 216px;
	height: 35px;
	overflow: hidden;
	background: #000;
	color: #fff;
	transition: height var(--dm-dur) var(--dm-ease), background-color .3s, color .3s;
}
.dm-header--light .dm-header__contact { background: #fff; color: #000; }
.dm-header__contact.is-open { height: 227px; }
.dm-header .dm-header__contact-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 35px;
	padding: 0 14px !important;
	text-transform: uppercase;
}

/* + morphs to − : the minus is the plus's own horizontal stroke */
.dm-header__contact-icon { position: relative; width: 10px; height: 10px; }
.dm-header__contact-icon svg { position: absolute; left: 0; top: 50%; }
.dm-header__plus { width: 10px; height: 10px; margin-top: -5px; transition: transform var(--dm-dur) var(--dm-ease); }
.dm-header__minus { width: 10px; height: 1px; margin-top: -.5px; }
.dm-header__contact.is-open .dm-header__plus { transform: scaleY(0); }

/* Links at y=156, x=14 */
.dm-header__contact-panel {
	position: absolute;
	top: 156px;
	left: 14px;
	right: 14px;
	visibility: hidden;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .13s ease, transform var(--dm-dur) var(--dm-ease), visibility 0s var(--dm-dur);
}
.dm-header__contact.is-open .dm-header__contact-panel {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity .22s ease .2s, transform var(--dm-dur) var(--dm-ease) .11s, visibility 0s;
}
.dm-header__contact-link {
	display: flex;
	align-items: flex-start;
	gap: 4px;
	font-size: 14px;
	line-height: 19px;
	letter-spacing: -.02em;
}
.dm-header__contact-link--phone { text-transform: uppercase; }
.dm-header__contact-link svg { width: 8.2px; height: 8.2px; margin-top: 6px; }

/* ---------- Auto-contrast sampling: let elementFromPoint see through the header ---------- */
.dm-header.is-sampling,
.dm-header.is-sampling * { pointer-events: none !important; }

/* ---------- Scroll lock while the mobile panel is open ---------- */
html.dm-lock, html.dm-lock body { overflow: hidden; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.dm-header,
	.dm-header__drawer,
	.dm-header__sub,
	.dm-header__item--acc .dm-header__link svg,
	.dm-header__contact,
	.dm-header__panel,
	.dm-header__contact-panel,
	.dm-header__burger path,
	.dm-header__plus,
	.dm-header__card::after { transition-duration: .01ms; transition-delay: 0s; }
	.dm-header__cities > span { animation: none; transform: none; }
	.dm-header__cities > span:not(:first-child) { display: none; }
}

/* ============================================================
   Mobile / tablet — up to Elementor's tablet breakpoint (1024 is baked in; the plugin
   rewrites it when the site uses another value). One 343×38 bar: logo, EL, burger.
   Open: the same box grows to 581px (Figma "Menu" 823:4904).
   ============================================================ */
@media (max-width: 1024px) {
	.dm-header__inner { padding: 13px var(--dm-side) 0; }
	.dm-header__row { position: relative; display: block; height: 38px; color: #fff; } /* the bar is dark: logo always white */

	.dm-header__menu {
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		width: auto;
		margin: 0;
	}
	.dm-header__bar { height: 38px; padding: 0 11px; justify-content: flex-end; }
	.dm-header__label { display: none; }
	.dm-header__tools { gap: 13px; }
	.dm-header__burger svg { width: 44px; }

	/* Logo sits in the bar, above the growing box; always white on the dark bar */
	.dm-header__logo,
	.dm-header--home .dm-header__logo {
		position: absolute;
		z-index: 2;
		left: 11px;
		top: 0;
		display: flex;
		height: 38px;
		margin: 0;
		gap: 6.4px;
	}
	.dm-header__logo svg,
	.dm-header__logo img { height: 13.8px; }

	/* Home: the ticker moves under the bar (Figma x=27 y=66 with the bar at y=17).
	   It hides as soon as the page scrolls (back only at the top) and while the menu is open. */
	.dm-header__available {
		position: absolute;
		z-index: 1;
		left: 11px;
		top: 49px;
		margin: 0;
		transition: opacity .3s ease, transform .3s ease, visibility 0s;
	}
	.dm-header.is-scrolled .dm-header__available,
	.dm-header.is-open .dm-header__available {
		opacity: 0;
		transform: translateY(-6px);
		visibility: hidden;
		transition: opacity .25s ease, transform .25s ease, visibility 0s .25s;
	}

	/* Panel: rows at y=82, x=11; rules 12px below/above the rows; cards 95×144 at y=205; 32px under the contact lines */
	.dm-header__panel-in { padding: 44px 11px 32px; }
	.dm-header__item { padding: 12px 0; }
	.dm-header__cards { padding: 15px 0 6px; }
	.dm-header__card { width: 95px; }
	.dm-header__card-foot { left: 7px; right: 7px; font-size: 11px; }

	/* Phone + email at y=511 (the last rule is at 455) */
	.dm-header__panel-contact { display: block; margin-top: 52px; }
	.dm-header__panel-contact .dm-header__contact-link { color: #fff; }

	.dm-header__contact { display: none; }
}
