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

[hidden] {
	display: none !important;
}

/* Offset anchor scroll targets by sticky nav height */
[id] {
	scroll-margin-top: 61px;
}

:root {
	--bg: #0a0c10;
	--surface: #111418;
	--surface-2: #161b22;
	--border: #1e2530;
	--accent: #4f8ef7;
	--accent-2: #7c3aed;
	--text: #e8eaf0;
	--muted: #8892a4;
	--danger: #ef4444;
	--success: #22c55e;
	--warn: #f59e0b;
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: "Inter", system-ui, -apple-system, sans-serif;
	line-height: 1.6;
	min-height: 100vh;
}

/* ── NAV ── */
nav {
	position: sticky;
	top: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 2rem;
	height: 60px;
	min-height: 60px;
	max-height: 60px;
	background: rgba(10, 12, 16, 0.92);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
	overflow: hidden;
	box-sizing: border-box;
}

.nav-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 100%;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--text);
	text-decoration: none;
	transition: opacity 0.2s;
}

.logo-icon {
	width: 26px;
	height: 26px;
	min-width: 26px;
	min-height: 26px;
	flex-shrink: 0;
	display: block;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.nav-logo:hover {
	opacity: 0.75;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: var(--accent);
}

.nav-logo-text span {
	color: var(--accent);
}

.nav-home {
	color: var(--muted) !important;
	font-size: 0.875rem;
}

.nav-links {
	display: flex;
	align-items: center;
	height: 100%;
	gap: 1.5rem;
	list-style: none;
}

.nav-links a {
	color: var(--muted);
	text-decoration: none;
	font-size: 0.875rem;
	transition: color 0.2s;
}

.nav-links a:hover {
	color: var(--text);
}

.btn-nav {
	color: #fff !important;
	padding: 0.4rem 1rem;
	border-radius: 6px;
	font-weight: 600;
	transition: opacity 0.2s !important;
}

.btn-nav:hover {
	opacity: 0.85;
}

/* ── FOOTER ── */
footer {
	border-top: 1px solid var(--border);
	padding: 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

@media (max-width: 640px) {
	footer {
		flex-direction: column;
		text-align: center;
		padding: 2rem 1rem;
	}

	footer nav {
		flex-direction: row;
		background: none;
		backdrop-filter: none;
		border: none;
		padding: 0;
		height: auto;
		justify-content: center;
		position: static;
	}

	footer nav a {
		margin: 0 0.75rem;
	}
}

footer p {
	color: var(--muted);
	font-size: 0.8rem;
}

footer nav a {
	color: var(--muted);
	text-decoration: none;
	font-size: 0.8rem;
	margin-left: 1.5rem;
	transition: color 0.2s;
}

footer nav a:hover {
	color: var(--text);
}

/* ── DIVIDER ── */
.divider {
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border), transparent);
	margin: 0 2rem;
}

/* ── SCROLL-TO-TOP BUTTON ── */
.scroll-top-btn {
	position: fixed;
	bottom: 5.5rem; /* Lifted to avoid footer overlap */
	right: 2rem;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--accent-2);
	color: #fff;
	border: none;
	font-size: 1.1rem;
	cursor: pointer;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.25s, transform 0.25s;
	pointer-events: none;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.scroll-top-btn.visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.scroll-top-btn:hover {
	opacity: 0.85;
}

/* ── PULSE ANIMATION ── */
@keyframes pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.25;
	}
}

/* ── RESPONSIVE NAV ── */
@media (max-width: 640px) {
	nav {
		padding: 0 1rem;
		flex-direction: column;
		height: auto;
		min-height: auto;
		max-height: none;
		gap: 0.75rem;
		padding-top: 0.75rem;
		padding-bottom: 0.75rem;
	}

	.nav-logo {
		height: 32px;
	}

	.nav-links {
		width: 100%;
		justify-content: center;
		gap: 1rem;
		flex-wrap: wrap;
	}

	.nav-links a {
		font-size: 0.8rem;
	}

	.btn-nav {
		padding: 0.3rem 0.75rem;
	}

	/* Ensure anchor offsets match new nav height (approx 85-90px) */
	[id] {
		scroll-margin-top: 100px;
	}
}

/* ── NAV: Dev Portal link ── */
#nav-portal-link {
	color: var(--muted);
	font-size: 0.875rem;
	text-decoration: none;
	transition: color 0.2s;
}

#nav-portal-link:hover {
	color: var(--text);
}

/* On small screens all links are now visible in a stacked sub-header layout. */

/* ── INLINE STYLES FROM HTML ── */
/* Footer inline styles */
footer p.footer-credits {
	font-size: 0.8rem;
	color: var(--muted);
	margin-top: 0.25rem;
}

footer p.footer-credits a {
	color: var(--muted);
	text-decoration: underline;
}

/* ── CONCEPT 2: THE HEXAGONAL MODEL NODE (CUBE) ANIMATIONS ── */

.logo-cube-group {
	transform-origin: 16px 16px;
	animation: cube-group-float 4s infinite ease-in-out;
}

.logo-cube-top,
.logo-cube-left,
.logo-cube-right {
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s
		ease;
}

.logo-cube-core {
	transform-origin: 16px 16px;
	animation: cube-core-resting 4s infinite ease-in-out;
}

/* Active Hover States */
.nav-logo:hover .logo-cube-top {
	transform: translateY(-3px);
	fill-opacity: 1;
}

.nav-logo:hover .logo-cube-left {
	transform: translate(-2px, 1.2px);
	fill-opacity: 0.95;
}

.nav-logo:hover .logo-cube-right {
	transform: translate(2px, 1.2px);
	fill-opacity: 0.85;
	stroke-width: 2px;
}

.nav-logo:hover .logo-cube-core {
	animation: cube-core-active 1.2s infinite ease-in-out;
}

@keyframes cube-group-float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-1.5px);
	}
}

@keyframes cube-core-resting {
	0%,
	100% {
		opacity: 0.5;
		transform: scale(0.9);
	}
	50% {
		opacity: 0.9;
		transform: scale(1.1);
	}
}

@keyframes cube-core-active {
	0%,
	100% {
		opacity: 0.7;
		transform: scale(1.1);
		filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px #4f8ef7);
	}
	50% {
		opacity: 1;
		transform: scale(1.5);
		filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 8px #7c3aed);
	}
}
