/* =========================================================================
   ELSARA / 4UP - global styles (R1 foundation)
   Design tokens extracted from the live Framer site.
   ========================================================================= */

:root {
	/* Brand */
	--blue: #1863DC;
	--blue-dark: #1450b4;
	--ink: #212121;
	--muted: #696A6D;
	--line: #e6e7ea;
	--bg: #ffffff;
	--bg-soft: #f4f5f7;
	--dark: #111315;

	/* Type */
	--font-display: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	/* Layout */
	--container: 1200px;
	--gutter: 24px;
	--radius: 16px;
	--radius-pill: 999px;
	--header-h: 76px;
}

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

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

body {
	margin: 0;
	font-family: var(--font-ui);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 .5em; line-height: 1.1; }
h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
h3 { font-size: 20px; font-weight: 500; line-height: 1.4; }

p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, 96px); }

/* ---- Accessibility helpers ---- */
.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 1000;
	background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- Buttons ---- */
.btn {
	display: inline-flex; align-items: center; gap: .5em;
	font-family: var(--font-ui); font-weight: 600; font-size: 15px;
	padding: 12px 22px; border-radius: var(--radius-pill);
	border: 1px solid transparent; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--dark { background: var(--dark); color: #fff; }
.btn--dark:hover { background: #000; color: #fff; }
.btn--call { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--call:hover { border-color: var(--blue); color: var(--blue); }

/* Gentle lift on pointer devices; collapsed under reduced motion below. */
@media (hover: hover) and (pointer: fine) {
	.btn { transition: background .2s ease, color .2s ease, border-color .2s ease, transform .22s ease, box-shadow .22s ease; }
	.btn:hover { transform: translateY(-1px); }
	.btn--primary:hover { box-shadow: 0 10px 24px rgba(24,99,220,.28); }
	.btn--dark:hover { box-shadow: 0 10px 24px rgba(0,0,0,.24); }
}

/* ---- Header ---- */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(17, 19, 21, .92); backdrop-filter: saturate(140%) blur(6px);
	color: #fff; min-height: var(--header-h);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.site-header__brand { margin-right: auto; }
.site-logo-text { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: #fff; letter-spacing: -0.01em; }
.site-logo-text strong { color: var(--blue); }
.site-logo-text span { font-weight: 500; opacity: .85; }
.custom-logo { max-height: 48px; width: auto; }
.site-logo { display: inline-flex; align-items: center; }
.site-logo img { height: 44px; width: auto; display: block; }

.site-nav .primary-menu { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.site-nav .primary-menu a { color: #fff; font-size: 15px; font-weight: 500; opacity: .92; }
.site-nav .primary-menu a:hover { opacity: 1; color: #fff; }
.site-nav .primary-menu .menu-item { position: relative; }

/* Animated underline on desktop nav (top level only, pointer devices).
   Uses ::before so ::after stays free for the dropdown chevron. */
@media (hover: hover) and (pointer: fine) {
	.site-nav .primary-menu > .menu-item > a { position: relative; padding-bottom: 4px; }
	.site-nav .primary-menu > .menu-item > a::before {
		content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
		background: var(--blue); border-radius: 2px;
		transform: scaleX(0); transform-origin: left center;
		transition: transform .24s ease;
	}
	.site-nav .primary-menu > .menu-item > a:hover::before,
	.site-nav .primary-menu > .menu-item > a:focus-visible::before { transform: scaleX(1); }
}

/* Dropdown indicator: chevron on any top-level item with children (applies to
   both the built-in fallback and admin-built menus). Rotates when open. */
.site-nav .primary-menu > .menu-item-has-children > a::after {
	content: "▾";
	display: inline-block;
	margin-left: 6px;
	font-size: 11px;
	opacity: .85;
	transition: transform .2s ease;
}
.site-nav .primary-menu > .menu-item-has-children:hover > a::after,
.site-nav .primary-menu > .menu-item-has-children:focus-within > a::after {
	transform: rotate(180deg);
}

/* Dropdown sub-menus.
   Robustness against accidental close:
   1. the parent <li> stretches to the full header height (big hitbox),
   2. an invisible ::before bridge covers the 6px visual gap,
   3. closing has a ~0.4s grace delay (visibility included in the transition),
   so crossing from "Nacele" to the panel can't drop the hover. */
.site-nav .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 220px;
	list-style: none; margin: 6px 0 0; padding: 8px;
	background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .16s ease .24s, transform .16s ease .24s, visibility 0s linear .4s;
}
.site-nav .menu-item:hover > .sub-menu,
.site-nav .menu-item:focus-within > .sub-menu {
	opacity: 1; visibility: visible; transform: none;
	transition: opacity .18s ease, transform .18s ease, visibility 0s;
}

/* Desktop: full-header-height hover targets on top-level items. Same visual
   spacing (14px gap + 6px padding each side = the former 26px), but the whole
   strip above and around each label is hoverable now. */
@media (min-width: 901px) {
	.site-nav .primary-menu { gap: 14px; }
	.site-nav .primary-menu > .menu-item { display: flex; align-items: center; min-height: var(--header-h); padding-inline: 6px; }
	/* Invisible bridge over the 6px gap between the item and its panel. */
	.site-nav .sub-menu::before {
		content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
	}
}
.site-nav .sub-menu a { color: var(--ink); display: block; padding: 8px 12px; border-radius: 8px; }
.site-nav .sub-menu a:hover { color: var(--ink); background: var(--bg-soft); }

.nav-toggle { display: none; }

/* ---- Footer ---- */
.site-footer { background: var(--dark); color: #cfd2d6; padding-block: 56px 28px; }
.site-footer__cta-line { font-family: var(--font-display); font-size: clamp(22px, 3vw, 32px); color: #fff; margin-bottom: 28px; }
.site-footer__grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.site-footer__company { display: flex; flex-direction: column; gap: 6px; }
.site-footer__company strong { color: #fff; font-size: 17px; }
.site-footer__company a:hover { color: #fff; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.site-footer__legal a:hover { color: #fff; }
.site-footer__copy { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }

/* ---- WhatsApp float ---- */
.whatsapp-float {
	position: fixed; right: 20px; bottom: 20px; z-index: 200;
	width: 56px; height: 56px; border-radius: 50%;
	display: grid; place-items: center; color: #fff; background: #25D366;
	box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .2s ease;
}
.whatsapp-float:hover { transform: translateY(-2px); }

/* ---- Scroll reveal (progressive enhancement) ----
   No JS  -> content is fully visible (no .has-js class).
   JS on  -> starts hidden, revealed by IntersectionObserver.
   Reduced motion -> instant, no transition. */
.has-js .reveal { opacity: 0; transform: translateY(24px); }
.has-js .reveal.is-visible { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }

/* Grid stagger: children of card/tile grids cascade in (~70ms steps, capped
   at .35s total so nothing feels slow). Reduced-motion kills all of it via
   the transition:none override below. */
.has-js :is(.cat-tiles, .cards-grid, .why-grid, .steps-grid, .reviews-grid, .services-grid, .contact-grid) > .reveal.is-visible:nth-child(2) { transition-delay: .07s; }
.has-js :is(.cat-tiles, .cards-grid, .why-grid, .steps-grid, .reviews-grid, .services-grid, .contact-grid) > .reveal.is-visible:nth-child(3) { transition-delay: .14s; }
.has-js :is(.cat-tiles, .cards-grid, .why-grid, .steps-grid, .reviews-grid, .services-grid, .contact-grid) > .reveal.is-visible:nth-child(4) { transition-delay: .21s; }
.has-js :is(.cat-tiles, .cards-grid, .why-grid, .steps-grid, .reviews-grid, .services-grid, .contact-grid) > .reveal.is-visible:nth-child(5) { transition-delay: .28s; }
.has-js :is(.cat-tiles, .cards-grid, .why-grid, .steps-grid, .reviews-grid, .services-grid, .contact-grid) > .reveal.is-visible:nth-child(n+6) { transition-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
	.has-js .reveal,
	.has-js .reveal.is-visible { opacity: 1 !important; transform: none !important; transition: none !important; }
	html { scroll-behavior: auto !important; }
	.btn, .btn:hover { transition: none; transform: none; box-shadow: none; }
	.site-nav .primary-menu > .menu-item > a::before { transition: none; }
	.site-nav .sub-menu,
	.site-nav .menu-item:hover > .sub-menu,
	.site-nav .menu-item:focus-within > .sub-menu { transition: none; transform: none; }
	.site-nav .primary-menu > .menu-item-has-children > a::after,
	.site-nav .primary-menu > .menu-item-has-children:hover > a::after { transition: none; transform: none; }
}

/* ---- Simple pages: legal, thank-you, 404 ---- */
.legal__inner, .thankyou__inner { max-width: 820px; }
.legal__title { margin-bottom: 24px; }
.legal__content { color: #33363b; }
.legal__content h2 { margin-top: 32px; }
.thankyou { text-align: center; }
.thankyou__inner { margin-inline: auto; }
.thankyou__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(24,99,220,.10); color: var(--blue); font-size: 30px; margin-bottom: 18px; }
.thankyou__content { color: var(--muted); font-size: 18px; margin-bottom: 24px; }
.error-404 { text-align: center; }
.error-404__inner { max-width: 620px; margin-inline: auto; }
.error-404__code { font-family: var(--font-display); font-weight: 700; font-size: clamp(64px,12vw,120px); color: var(--blue); line-height: 1; margin: 0; }
.error-404__title { margin: 8px 0 12px; }
.error-404__text { color: var(--muted); margin-bottom: 24px; }
.error-404__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Quote form ---- */
.quote-form { display: grid; gap: 14px; max-width: 540px; }
.quote-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.quote-form input, .quote-form textarea { font-family: var(--font-ui); font-size: 15px; color: var(--ink); padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.quote-form input:focus-visible, .quote-form textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.quote-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quote-form .hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 600px) { .quote-form__row { grid-template-columns: 1fr; } }

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.site-nav { position: fixed; inset: var(--header-h) 0 auto 0; background: #111315; padding: 16px var(--gutter) 24px; display: none; }
	.site-header.nav-open .site-nav { display: block; }
	.site-nav .primary-menu { flex-direction: column; gap: 4px; }
	.site-nav .primary-menu a { display: block; padding: 12px 4px; font-size: 17px; }
	/* Mobile: submenu always expanded, clearly nested under its parent. */
	.site-nav .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
		background: transparent; margin: 2px 0 6px; padding: 0 0 0 16px;
		border-left: 2px solid rgba(255,255,255,.18);
	}
	.site-nav .sub-menu a { color: #cfd2d6; font-size: 15px; padding: 9px 4px; }
	.site-nav .sub-menu a:hover { color: #fff; }
	.site-nav .primary-menu > .menu-item-has-children > a::after { opacity: .7; }
	.btn--call { display: none; }
	.nav-toggle {
		display: inline-flex; flex-direction: column; gap: 5px; justify-content: center;
		width: 44px; height: 44px; background: transparent; border: 0; cursor: pointer;
	}
	.nav-toggle span { width: 24px; height: 2px; background: #fff; display: block; transition: transform .2s ease, opacity .2s ease; }
	.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
	.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
