body { position: relative; overflow-x: hidden; }
.page-lattice { display: none !important; }

/* =================================================================
   Topbar
================================================================= */
.topbar {
	position: sticky; top: 0; z-index: 50;
	backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
	background: rgba(5, 14, 31, 0.72);
	border-bottom: 1px solid rgba(157, 178, 206, 0.08);
	transition: background 240ms ease, border-color 240ms ease;
}
[data-theme="light"] .topbar {
	background: rgba(245, 248, 255, 0.78);
	border-bottom-color: rgba(11, 42, 74, 0.10);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.topbar__brand {
	display: inline-flex; align-items: center; gap: 14px;
	text-decoration: none; line-height: 1;
}
.topbar__brand .wordmark {
	font-family: 'Segoe UI Variable', Inter, sans-serif;
	font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
	color: var(--text-primary);
}
.topbar__brand .wordmark .iq {
	background: linear-gradient(90deg, var(--brand-electric-azure), var(--brand-cyan-glow));
	-webkit-background-clip: text; background-clip: text; color: transparent;
	font-weight: 700;
}

.topbar__nav { display: flex; gap: 26px; align-items: center; }
.topbar__nav a {
	position: relative;
	color: var(--text-secondary); text-decoration: none;
	font-size: 0.9375rem; font-weight: 500;
	padding: 6px 2px;
	transition: color 150ms ease;
}
.topbar__nav a:hover { color: var(--text-primary); }
.topbar__nav a.is-active { color: var(--text-primary); font-weight: 600; }
.topbar__nav a.is-active::after {
	content: ""; position: absolute;
	left: 0; right: 0; bottom: -22px; height: 2px;
	background: linear-gradient(90deg, var(--brand-electric-azure), var(--brand-cyan-glow));
	border-radius: 2px;
}

.topbar__actions { display: flex; align-items: center; gap: 14px; }
.topbar__theme-toggle {
	width: 38px; height: 38px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(157, 178, 206, 0.18);
	color: var(--text-secondary);
	cursor: pointer;
	transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
	font-family: inherit;
}
.topbar__theme-toggle:hover {
	color: var(--brand-cyan-glow);
	border-color: rgba(32, 227, 255, 0.40);
	background: rgba(32, 227, 255, 0.06);
}
.topbar__theme-toggle svg { width: 18px; height: 18px; }
.topbar__theme-toggle .icon-sun { display: none; }
[data-theme="light"] .topbar__theme-toggle .icon-moon { display: none; }
[data-theme="light"] .topbar__theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .topbar__theme-toggle {
	background: rgba(11, 42, 74, 0.04);
	border-color: rgba(11, 42, 74, 0.18);
	color: var(--text-secondary);
}
[data-theme="light"] .topbar__theme-toggle:hover {
	color: var(--brand-electric-azure);
	border-color: rgba(45, 125, 255, 0.40);
	background: rgba(45, 125, 255, 0.06);
}

.topbar__cta {
	padding: 11px 20px; border-radius: 8px;
	background: var(--brand-electric-azure); color: #fff;
	font-weight: 600; font-size: 0.875rem; text-decoration: none;
	transition: filter 150ms ease;
	box-shadow: 0 6px 18px rgba(45, 125, 255, 0.30);
}
.topbar__cta:hover { filter: brightness(1.08); }

/* Hamburger toggle — hidden on desktop, visible on mobile */
.topbar__menu-toggle {
	display: none;
	width: 40px; height: 40px;
	flex-direction: column; align-items: center; justify-content: center;
	gap: 5px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(157, 178, 206, 0.18);
	cursor: pointer;
	padding: 0;
	transition: border-color 150ms ease, background 150ms ease;
}
.topbar__menu-toggle:hover {
	border-color: rgba(32, 227, 255, 0.40);
	background: rgba(32, 227, 255, 0.06);
}
.topbar__menu-toggle__bar {
	display: block;
	width: 18px; height: 2px;
	background: var(--text-secondary);
	border-radius: 2px;
	transition: transform 200ms ease, opacity 200ms ease;
}
.topbar__menu-toggle[aria-expanded="true"] .topbar__menu-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.topbar__menu-toggle[aria-expanded="true"] .topbar__menu-toggle__bar:nth-child(2) {
	opacity: 0;
}
.topbar__menu-toggle[aria-expanded="true"] .topbar__menu-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}
[data-theme="light"] .topbar__menu-toggle {
	background: rgba(11, 42, 74, 0.04);
	border-color: rgba(11, 42, 74, 0.18);
}
[data-theme="light"] .topbar__menu-toggle:hover {
	border-color: rgba(45, 125, 255, 0.40);
	background: rgba(45, 125, 255, 0.06);
}

@media (max-width: 1100px) {
	.topbar__nav { gap: 18px; }
	.topbar__nav a { font-size: 0.875rem; }
}

@media (max-width: 960px) {
	.topbar__menu-toggle { display: inline-flex; }

	.topbar__nav {
		position: absolute;
		top: 72px; left: 0; right: 0;
		display: flex;
		flex-direction: column;
		gap: 0;
		padding: 8px 0;
		background: rgba(5, 14, 31, 0.96);
		backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
		border-bottom: 1px solid rgba(157, 178, 206, 0.10);
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		visibility: hidden;
		transition: max-height 280ms ease, opacity 200ms ease, visibility 0s linear 280ms;
	}
	.topbar__nav[data-open="true"] {
		max-height: calc(100vh - 72px);
		opacity: 1;
		visibility: visible;
		transition: max-height 280ms ease, opacity 200ms ease, visibility 0s linear 0s;
	}
	.topbar__nav a {
		padding: 14px 24px;
		font-size: 1rem;
		border-bottom: 1px solid rgba(157, 178, 206, 0.06);
	}
	.topbar__nav a:last-child { border-bottom: 0; }
	.topbar__nav a.is-active::after { display: none; }
	.topbar__nav a.is-active {
		color: var(--brand-cyan-glow);
		background: rgba(32, 227, 255, 0.06);
	}
	[data-theme="light"] .topbar__nav {
		background: rgba(245, 248, 255, 0.97);
		border-bottom-color: rgba(11, 42, 74, 0.10);
	}
	[data-theme="light"] .topbar__nav a {
		border-bottom-color: rgba(11, 42, 74, 0.06);
	}
	[data-theme="light"] .topbar__nav a.is-active {
		color: var(--brand-electric-azure);
		background: rgba(45, 125, 255, 0.06);
	}
}

@media (max-width: 540px) {
	.topbar__cta { padding: 9px 14px; font-size: 0.8125rem; }
	.topbar__theme-toggle { width: 36px; height: 36px; }
	.topbar__menu-toggle { width: 36px; height: 36px; }
	.topbar__actions { gap: 8px; }
}

/* All page sections sit above the lattice. */
.hero, .isv-band, .panels-band, .philosophy,
.section, .platform-section, .footer { position: relative; z-index: 1; }
