/*
 * Divonex site chrome: sticky glass header and dark footer.
 * Hooks onto the dx-header / dx-footer template parts.
 */

html { scroll-padding-top: 96px; }

/* ---------- Header ---------- */

/* Template parts render a wrapper element; make that wrapper the sticky element. */
.wp-site-blocks > .wp-block-template-part:has(> .dx-header),
.wp-site-blocks > header.wp-block-template-part:has(> .dx-header) {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
	margin: 0;
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.wp-site-blocks > .wp-block-template-part.dx-header-hidden { transform: translateY(-100%); }
@media (max-width: 600px) {
	.wp-site-blocks > .wp-block-template-part:has(> .dx-header) { top: 0; }
}

.dx-header { margin: 0 !important; }
.dx-header__bar {
	position: relative;
	isolation: isolate;
	padding: 14px var(--wp--preset--spacing--edge, 15px) !important;
	transition: padding 0.3s;
}
/* Glass layer lives on a pseudo-element: backdrop-filter on the bar itself would trap the
   fixed-position mobile menu inside the header's box. */
.dx-header__bar::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(255, 255, 255, 0.8);
	border-bottom: 1px solid rgba(11, 15, 28, 0.05);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.dx-header.is-scrolled .dx-header__bar {
	padding-top: 9px !important;
	padding-bottom: 9px !important;
}
.dx-header.is-scrolled .dx-header__bar::before {
	background: rgba(255, 255, 255, 0.86);
	border-bottom-color: rgba(11, 15, 28, 0.07);
	box-shadow: 0 10px 30px -18px rgba(11, 15, 28, 0.25);
}
/* Reading progress, driven by --dx-read from chrome.js */
.dx-header__bar::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 100%;
	background: linear-gradient(90deg, #2b59ff, #5817e6 60%, #b63cf0);
	transform: scaleX(var(--dx-read, 0));
	transform-origin: left;
	opacity: 0;
	transition: opacity 0.3s;
}
.dx-header.is-scrolled .dx-header__bar::after { opacity: 1; }

.dx-header__row { gap: 24px !important; }

.dx-brand { gap: 10px !important; }
.dx-brand .wp-block-site-logo img { transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.dx-brand:hover .wp-block-site-logo img { transform: rotate(-8deg) scale(1.08); }
.dx-brand .wp-block-site-title { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.dx-brand .wp-block-site-title a { color: #0b0f1c; text-decoration: none; }

/* Navigation (divonex/navigation renders a classic menu) */
.dx-header .wp-block-divonex-navigation { flex: 1; }
.dx-header .divonex-desktop { position: relative; gap: 2px; }
.dx-header .divonex-desktop > li > a {
	position: relative;
	z-index: 1;
	padding: 8px 14px !important;
	border-radius: 10px;
	color: #3b4357 !important;
	font-size: 0.95rem;
	font-weight: 500;
	background: transparent !important;
}
.dx-header .divonex-desktop > li > a:hover,
.dx-header .divonex-desktop > li:focus-within > a { color: #0b0f1c !important; }
.dx-header .divonex-desktop > li.current-menu-item > a,
.dx-header .divonex-desktop > li.current-menu-ancestor > a,
.dx-header .divonex-desktop > li.current-page-ancestor > a { color: #0b0f1c !important; }
.dx-header .divonex-desktop > li.current-menu-item > a::after,
.dx-header .divonex-desktop > li.current-page-ancestor > a::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 2px;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: #2b59ff;
}
/* Sliding hover pill, inserted by chrome.js */
.dx-nav-pill {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 0;
	border-radius: 10px;
	background: rgba(43, 89, 255, 0.07);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), width 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
.dx-nav-pill.is-on { opacity: 1; }

/* Dropdown chevron */
.dx-header .divonex-desktop > li.menu-item-has-children > a { gap: 6px; }
.dx-header .divonex-desktop > li.menu-item-has-children > a::before {
	content: "";
	order: 2;
	width: 7px;
	height: 7px;
	margin-top: -3px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.6;
	transition: transform 0.25s, margin 0.25s;
}
.dx-header .divonex-desktop > li.menu-item-has-children:hover > a::before,
.dx-header .divonex-desktop > li.menu-item-has-children:focus-within > a::before { transform: rotate(-135deg); margin-top: 3px; }

/* Dropdown card */
.dx-header .divonex-desktop .sub-menu {
	left: 50% !important;
	min-width: 250px !important;
	padding: 8px !important;
	border: 1px solid rgba(11, 15, 28, 0.08) !important;
	border-radius: 16px !important;
	background: rgba(255, 255, 255, 0.96) !important;
	box-shadow: 0 24px 60px -20px rgba(26, 43, 110, 0.35), 0 2px 6px rgba(11, 15, 28, 0.04);
	transform: translate(-50%, 10px) scale(0.98) !important;
	transform-origin: top center;
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	transition: opacity 0.2s, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s !important;
}
.dx-header .divonex-desktop > li:hover > .sub-menu,
.dx-header .divonex-desktop > li:focus-within > .sub-menu {
	opacity: 1 !important;
	visibility: visible !important;
	transform: translate(-50%, 6px) scale(1) !important;
}
/* Hover bridge so the menu doesn't close while the pointer crosses the gap */
.dx-header .divonex-desktop .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.dx-header .divonex-desktop .sub-menu li { border: 0 !important; }
.dx-header .divonex-desktop .sub-menu a {
	display: flex !important;
	align-items: center;
	gap: 12px;
	padding: 10px 12px !important;
	border-radius: 10px;
	color: #242c42 !important;
	font-size: 0.93rem;
	font-weight: 500;
	transition: background-color 0.2s, color 0.2s, padding 0.2s;
}
.dx-header .divonex-desktop .sub-menu a::before {
	content: "";
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: linear-gradient(135deg, rgba(43, 89, 255, 0.12), rgba(88, 23, 230, 0.12)) center / 16px no-repeat;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b59ff' stroke-width='1.8'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M9 10v10'/%3E%3C/svg%3E"), linear-gradient(135deg, rgba(43, 89, 255, 0.12), rgba(88, 23, 230, 0.12));
	background-size: 16px, cover;
	background-position: center;
	background-repeat: no-repeat;
}
.dx-header .divonex-desktop .sub-menu a:hover { background: #f4f6fc; color: #0b0f1c !important; }
.dx-header .divonex-desktop .sub-menu a::after { content: "→"; margin-left: auto; opacity: 0; transform: translateX(-4px); transition: opacity 0.2s, transform 0.2s; color: #2b59ff; }
.dx-header .divonex-desktop .sub-menu a:hover::after { opacity: 1; transform: none; }

/* Actions */
.dx-header__actions { gap: 10px !important; }
.dx-pro-chip { margin: 0; font-size: 0.88rem; font-weight: 500; }
.dx-pro-chip a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 8px 7px 14px;
	border: 1px solid rgba(11, 15, 28, 0.1);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.7);
	color: #0b0f1c !important;
	text-decoration: none !important;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.dx-pro-chip a:hover { border-color: rgba(88, 23, 230, 0.4); box-shadow: 0 6px 18px -8px rgba(88, 23, 230, 0.45); }
.dx-pro-chip mark,
.dx-pro-chip span {
	padding: 2px 8px;
	border-radius: 999px;
	background: linear-gradient(120deg, #2b59ff, #5817e6 60%, #b63cf0);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.dx-header .dx-btns .wp-block-button__link { padding: 10px 16px !important; font-size: 0.9rem; border-radius: 11px; }

/* Mobile off-canvas (divonex/navigation) */
.dx-header .mobile-bars {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(11, 15, 28, 0.1) !important;
	border-radius: 11px;
	background: #fff !important;
}
.dx-header .mobile-bars svg { fill: #0b0f1c; }
.dx-header .divonex-overlay { background: rgba(11, 15, 28, 0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dx-header .divonex-mobile {
	width: min(86vw, 360px);
	min-width: 0 !important;
	padding: 20px 20px 32px !important;
	background: #fff !important;
	box-shadow: -30px 0 60px -30px rgba(11, 15, 28, 0.4);
	overflow-y: auto;
}
.dx-header .divonex-mobile .close-btn { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.dx-header .divonex-mobile .close-btn svg { width: 40px; height: 40px; padding: 8px; border-radius: 11px; background: #f4f6fc; }
.dx-header .divonex-mobile .close-btn path { stroke: #0b0f1c !important; }
.dx-header .divonex-mobile-menu > li { border-bottom: 1px solid #eef1f7; }
.dx-header .divonex-mobile-menu a {
	padding: 14px 6px !important;
	color: #0b0f1c !important;
	font-size: 1.1rem;
	font-weight: 600;
	background: none !important;
}
.dx-header .divonex-mobile-menu .sub-menu { margin: -6px 0 10px 6px !important; padding: 0 !important; }
.dx-header .divonex-mobile-menu .sub-menu a { padding: 8px 6px !important; color: #4a5268 !important; font-size: 0.98rem; font-weight: 500; }
.dx-header .divonex-mobile.is-active .divonex-mobile-menu > li { animation: dx-slide-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.dx-header .divonex-mobile.is-active .divonex-mobile-menu > li:nth-child(2) { animation-delay: 0.05s; }
.dx-header .divonex-mobile.is-active .divonex-mobile-menu > li:nth-child(3) { animation-delay: 0.1s; }
.dx-header .divonex-mobile.is-active .divonex-mobile-menu > li:nth-child(4) { animation-delay: 0.15s; }
.dx-header .divonex-mobile.is-active .divonex-mobile-menu > li:nth-child(5) { animation-delay: 0.2s; }
@keyframes dx-slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 1024px) {
	.dx-pro-chip { display: none; }
}
@media (max-width: 767px) {
	.dx-header .wp-block-divonex-navigation { flex: 0 0 auto; order: 3; }
	.dx-header__actions { margin-left: auto !important; }
}
@media (max-width: 420px) {
	.dx-header .dx-btns { display: none; }
}

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

.dx-footer {
	position: relative;
	margin: 0 !important;
	padding: clamp(56px, 8vw, 96px) var(--wp--preset--spacing--edge, 15px) 28px !important;
	background:
		radial-gradient(50% 40% at 20% 0%, rgba(43, 89, 255, 0.22), transparent 70%),
		radial-gradient(40% 35% at 85% 5%, rgba(88, 23, 230, 0.2), transparent 70%),
		#0b0f1c;
	color: #aab3c7;
	overflow: hidden;
	isolation: isolate;
}
.dx-footer::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(180deg, #000, transparent 55%);
	mask-image: linear-gradient(180deg, #000, transparent 55%);
}
.dx-footer a { color: inherit; text-decoration: none; }

.dx-footer__cta {
	gap: 32px !important;
	margin-bottom: clamp(48px, 7vw, 80px) !important;
	padding: clamp(24px, 4vw, 40px) !important;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 24px;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}
.dx-footer__cta > :first-child { flex: 1 1 320px; }
.dx-footer__cta > .wp-block-divonex-waitlist { flex: 1 1 380px; max-width: 460px; }
.dx-footer__cta h2 {
	margin: 0;
	color: #fff;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	line-height: 1.15;
	letter-spacing: -0.03em;
	font-weight: 700;
}
.dx-footer__cta p { margin: 0; }
.dx-footer .dx-kicker { color: #8ea6ff; margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

.dx-footer__cols { gap: clamp(28px, 5vw, 64px) !important; margin-bottom: clamp(40px, 6vw, 72px) !important; }
.dx-footer__brand .wp-block-site-title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.dx-footer__brand .wp-block-site-title a { color: #fff; }
.dx-footer .wp-block-site-tagline { margin: 16px 0 0; max-width: 320px; font-size: 0.95rem; line-height: 1.6; color: #8a93a8; }
.dx-footer__rating { margin: 20px 0 0 !important; font-size: 0.88rem; }
.dx-footer__rating a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px; transition: border-color 0.2s, background-color 0.2s; }
.dx-footer__rating a:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.04); }
.dx-footer__rating span { opacity: 0.7; }

.dx-footer-title { margin: 0 0 16px !important; color: #fff; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.dx-footer-links { margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.dx-footer-links li { margin: 0 0 10px; }
.dx-footer-links a {
	position: relative;
	display: inline-block;
	color: #aab3c7;
	transition: color 0.2s, transform 0.2s;
}
.dx-footer-links a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 100%;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.dx-footer-links a:hover { color: #fff; transform: translateX(2px); }
.dx-footer-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.dx-footer-links .dx-new { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(179, 155, 255, 0.16); color: #c9b8ff; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 1px; }

/* Giant wordmark; the highlight follows the cursor via --wx from chrome.js */
.dx-wordmark {
	margin: 0 auto 8px !important;
	/* Negative letter-spacing leaves trailing space after the last letter; balance it on the left. */
	padding-left: 0.07em;
	font-size: clamp(5rem, 21vw, 18rem);
	font-weight: 700;
	line-height: 0.8;
	letter-spacing: -0.07em;
	text-align: center;
	background: radial-gradient(circle at var(--wx, 50%) 30%, rgba(142, 166, 255, 0.55), rgba(255, 255, 255, 0.06) 40%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	user-select: none;
	-webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
	mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}

.dx-footer__bottom {
	gap: 16px !important;
	padding-top: 24px !important;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.86rem;
	color: #6b7590;
}
.dx-footer__bottom p { margin: 0; }
.dx-footer__bottom a:hover { color: #fff; }
.dx-footer__bottom .dx-totop { color: #aab3c7; }
.dx-footer .wp-block-social-links { gap: 8px !important; margin: 22px 0 0 !important; }
.dx-footer .wp-block-social-links .wp-social-link { margin: 0; }
.dx-footer .wp-block-social-links .wp-social-link a {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0 !important;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 11px;
	color: #aab3c7;
	transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.dx-footer .wp-block-social-links .wp-social-link a:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); transform: translateY(-2px); }

@media (max-width: 781px) {
	.dx-footer__cols .wp-block-column.dx-footer__brand { flex-basis: 100% !important; }
	.dx-footer__cols.wp-block-columns { flex-wrap: wrap !important; }
	.dx-footer__cols.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column:not(.dx-footer__brand) { flex-basis: calc(50% - 16px) !important; flex-grow: 1; }
	.dx-footer__bottom { justify-content: center !important; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.wp-site-blocks > .wp-block-template-part:has(> .dx-header) { transition: none; }
	.dx-header .divonex-mobile.is-active .divonex-mobile-menu > li { animation: none; }
}

/* Keep chrome readable in the editor */
.editor-styles-wrapper .dx-header__bar::before { background: #fff; }

/* Social icons: monochrome instead of brand colors */
.dx-footer .wp-block-social-links.is-style-logos-only .wp-social-link,
.dx-footer .wp-block-social-links.is-style-logos-only .wp-social-link a { color: #aab3c7 !important; background: none !important; }
.dx-footer .wp-block-social-links.is-style-logos-only .wp-social-link a:hover { color: #fff !important; }

/* Legal links in the footer bottom bar */
.dx-footer__legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.dx-footer__legal a { color: #8a93a8; text-decoration: none; transition: color 0.2s; }
.dx-footer__legal a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.dx-footer__bottom a[href*="gutenbergkits.com/"]:not(.dx-footer__legal a) { color: #aab3c7; }
