/* Header styles for Dawid Połomski DOP */

.ej-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: linear-gradient(
		to bottom,
		rgba(5, 6, 8, 0.96),
		rgba(5, 6, 8, 0.9)
	);
	border-bottom: 1px solid var(--color-border-subtle);
	backdrop-filter: blur(18px);
}

.ej-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: var(--space-4);
	padding-bottom: var(--space-4);
	gap: var(--space-4);
}

.ej-header__brand {
	display: flex;
	align-items: center;
	min-width: 0;
}

.ej-header__logo-link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
}

.ej-header__logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: radial-gradient(circle at 30% 0, #ffe9a8, #d9b15a);
	color: #201406;
	font-weight: 700;
	font-size: var(--font-size-sm);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	box-shadow: 0 12px 32px rgba(217, 177, 90, 0.6);
}

.ej-header__logo-text {
	display: flex;
	flex-direction: column;
}

.ej-header__logo-title {
	font-family: var(--font-display);
	font-size: var(--font-size-lg);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.ej-header__logo-subtitle {
	font-size: var(--font-size-xs);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-text-muted);
}

/* Navigation */

.ej-header__nav {
	display: flex;
}

.ej-header__nav-list {
	display: flex;
	align-items: center;
	gap: var(--space-5);
	list-style: none;
}

.ej-header__nav-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-size: var(--font-size-sm);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--color-text-muted);
}

.ej-header__nav-link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -0.5rem;
	width: 0;
	height: 2px;
	border-radius: var(--radius-full);
	background: linear-gradient(
		90deg,
		var(--color-primary),
		var(--color-accent-burgundy)
	);
	transition: width var(--transition-base);
}

.ej-header__nav-link:hover,
.ej-header__nav-link:focus-visible {
	color: var(--color-text);
}

.ej-header__nav-link:hover::after,
.ej-header__nav-link:focus-visible::after {
	width: 100%;
}

.ej-header__nav-item--accent .ej-header__nav-link {
	padding: 0.45rem 1.1rem;
	border-radius: var(--radius-full);
	border: 1px solid rgba(217, 177, 90, 0.6);
	background:
		radial-gradient(
			circle at top left,
			rgba(217, 177, 90, 0.16),
			transparent 60%
		),
		rgba(10, 11, 17, 0.96);
}

.ej-header__nav-link--cta::after {
	display: none;
}

.ej-header__nav-item--accent .ej-header__nav-link:hover,
.ej-header__nav-item--accent .ej-header__nav-link:focus-visible {
	background:
		radial-gradient(
			circle at top left,
			rgba(217, 177, 90, 0.28),
			transparent 60%
		),
		rgba(10, 11, 17, 0.98);
	box-shadow: var(--shadow-soft);
}

/* Mobile toggle */

.ej-header__toggle {
	display: none;
	position: relative;
	width: 42px;
	height: 34px;
	border-radius: var(--radius-full);
	border: 1px solid var(--color-border-subtle);
	background: rgba(10, 11, 17, 0.9);
	cursor: pointer;
	align-items: center;
	justify-content: center;
}

.ej-header__toggle-bar {
	position: absolute;
	width: 60%;
	height: 2px;
	border-radius: var(--radius-full);
	background: var(--color-text);
	transition:
		transform var(--transition-fast),
		opacity var(--transition-fast),
		top var(--transition-fast),
		bottom var(--transition-fast);
}

.ej-header__toggle-bar:first-child {
	top: 11px;
}

.ej-header__toggle-bar:last-child {
	bottom: 11px;
}

.ej-header__toggle[aria-expanded="true"] .ej-header__toggle-bar:first-child {
	top: 50%;
	transform: translateY(-50%) rotate(42deg);
}

.ej-header__toggle[aria-expanded="true"] .ej-header__toggle-bar:last-child {
	bottom: auto;
	top: 50%;
	transform: translateY(-50%) rotate(-42deg);
}

/* Mobile layout */

@media (max-width: 768px) {
	.ej-header__inner {
		padding-top: var(--space-3);
		padding-bottom: var(--space-3);
	}

	.ej-header__toggle {
		display: inline-flex;
	}

	.ej-header__nav {
		position: fixed;
		inset: 64px 0 auto 0;
		max-height: 0;
		overflow: hidden;
		background:
			radial-gradient(circle at top, rgba(217, 177, 90, 0.1), transparent 55%),
			rgba(5, 6, 8, 0.98);
		border-bottom: 1px solid transparent;
		transition:
			max-height var(--transition-slow),
			border-color var(--transition-base);
	}

	.ej-header__nav--open {
		max-height: 420px;
		border-color: var(--color-border-subtle);
	}

	.ej-header__nav-list {
		flex-direction: column;
		align-items: flex-start;
		padding: var(--space-4) var(--space-5) var(--space-5);
		gap: var(--space-3);
	}

	.ej-header__nav-item--accent {
		width: 100%;
	}

	.ej-header__nav-item--accent .ej-header__nav-link {
		justify-content: center;
		width: 100%;
	}

	.ej-header__nav-link::after {
		display: none;
	}
}

@media (max-width: 520px) {
	.ej-header__logo-subtitle {
		display: none;
	}
}

/* Ensure menu is visible if JS fails: progressive enhancement */

.no-js .ej-header__nav {
	position: static;
	max-height: none;
	border: none;
}

.no-js .ej-header__toggle {
	display: none;
}
