/* NA.OS — UI polish layer */

::selection {
	background: rgba(0, 229, 255, 0.25);
	color: var(--ne-text);
}

:focus-visible {
	outline: 2px solid rgba(0, 229, 255, 0.55);
	outline-offset: 3px;
}

.ne-scrollbar {
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 229, 255, 0.35) transparent;
}
.ne-scrollbar::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}
.ne-scrollbar::-webkit-scrollbar-track {
	background: transparent;
}
.ne-scrollbar::-webkit-scrollbar-thumb {
	background: rgba(0, 229, 255, 0.25);
	border-radius: 6px;
}
.ne-scrollbar::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 229, 255, 0.45);
}

/* Header scroll progress */
.ne-header__progress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 2px;
	width: 0;
	background: linear-gradient(90deg, var(--ne-cyan), var(--ne-green));
	box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
	transition: width 0.08s linear;
	pointer-events: none;
}
.ne-header.is-scrolled {
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Active nav */
.ne-nav-link.is-active {
	color: var(--ne-text);
}
.ne-nav-link.is-active::after {
	width: 100%;
	background: linear-gradient(90deg, var(--ne-cyan), var(--ne-green));
}

/* Section headers */
.ne-section__label {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
}
.ne-section__label::before {
	content: '';
	width: 1.25rem;
	height: 1px;
	background: linear-gradient(90deg, var(--ne-cyan), transparent);
}

/* Cards & modules */
.ne-module,
.ne-metric,
.ne-dossier {
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}
.ne-metric:hover {
	transform: translateY(-3px);
	border-color: rgba(0, 229, 255, 0.12);
}
.ne-dossier.is-open {
	border-color: rgba(0, 255, 136, 0.2);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.ne-dossier.is-open .ne-dossier__stamp {
	color: var(--ne-green);
}
.ne-dossier__content[hidden] {
	display: none;
}
.ne-dossier:not(.is-open) .ne-dossier__content {
	animation: none;
}
.ne-dossier.is-open .ne-dossier__content {
	animation: ne-fade-up 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ne-fade-up {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Timeline */
.ne-event.is-open .ne-event__trigger {
	border-color: rgba(0, 229, 255, 0.2);
}
.ne-event__detail {
	animation: ne-fade-up 0.4s ease;
}

/* Buttons */
.ne-btn:focus-visible,
.ne-hero-ai__chip:focus-visible,
.ne-chat-followups__chip:focus-visible {
	outline: 2px solid rgba(0, 229, 255, 0.5);
	outline-offset: 2px;
}
.ne-btn:active {
	transform: scale(0.98);
}
.ne-hero-ai__chip {
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.ne-hero-ai__chip:active {
	transform: scale(0.97);
}

/* Stream cursor */
.ne-stream-cursor {
	display: inline-block;
	color: var(--ne-cyan);
	animation: ne-ai-blink 0.9s step-end infinite;
	margin-left: 2px;
	font-size: 0.75rem;
	vertical-align: baseline;
}

/* Back to top */
.ne-back-top {
	position: fixed;
	right: 1.25rem;
	bottom: 5.5rem;
	z-index: 1050;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	border: 1px solid rgba(0, 229, 255, 0.25);
	background: rgba(10, 15, 22, 0.92);
	color: var(--ne-cyan);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, border-color 0.2s ease;
	backdrop-filter: blur(12px);
}
.ne-back-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.ne-back-top:hover {
	border-color: rgba(0, 229, 255, 0.5);
	background: rgba(0, 229, 255, 0.08);
}
body.ne-ai-panel-open .ne-back-top {
	opacity: 0;
	pointer-events: none;
}

/* Toasts */
.ne-toast-stack {
	position: fixed;
	top: calc(var(--ne-header-h) + 1rem);
	right: 1rem;
	z-index: 1300;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	max-width: min(360px, calc(100vw - 2rem));
	pointer-events: none;
}
.ne-toast {
	pointer-events: auto;
	padding: 0.75rem 1rem;
	border-radius: 10px;
	font-family: var(--ne-mono);
	font-size: 0.6875rem;
	line-height: 1.45;
	color: var(--ne-text);
	background: rgba(10, 15, 22, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
	animation: ne-toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	backdrop-filter: blur(16px);
}
.ne-toast--warn {
	border-color: rgba(251, 191, 36, 0.35);
	color: #fbbf24;
}
.ne-toast--success {
	border-color: rgba(0, 255, 136, 0.35);
	color: var(--ne-green);
}
@keyframes ne-toast-in {
	from { opacity: 0; transform: translateX(12px); }
	to { opacity: 1; transform: translateX(0); }
}

/* Mobile nav polish */
.ne-mobile-nav__link.is-active {
	color: var(--ne-cyan);
	padding-left: 0.35rem;
	border-left: 2px solid var(--ne-cyan);
}
@media (max-width: 768px) {
	.ne-mobile-nav.is-open a,
	.ne-mobile-nav.is-open .ne-mobile-nav__link,
	.ne-mobile-nav.is-open button {
		animation: ne-nav-item-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) backwards;
	}
	.ne-mobile-nav.is-open a:nth-child(1),
	.ne-mobile-nav.is-open .ne-mobile-nav__link:nth-child(1),
	.ne-mobile-nav.is-open button:nth-child(1) { animation-delay: 0.03s; }
	.ne-mobile-nav.is-open a:nth-child(2),
	.ne-mobile-nav.is-open .ne-mobile-nav__link:nth-child(2),
	.ne-mobile-nav.is-open button:nth-child(2) { animation-delay: 0.06s; }
	.ne-mobile-nav.is-open a:nth-child(3),
	.ne-mobile-nav.is-open .ne-mobile-nav__link:nth-child(3),
	.ne-mobile-nav.is-open button:nth-child(3) { animation-delay: 0.09s; }
	.ne-mobile-nav.is-open a:nth-child(4),
	.ne-mobile-nav.is-open .ne-mobile-nav__link:nth-child(4),
	.ne-mobile-nav.is-open button:nth-child(4) { animation-delay: 0.12s; }
	.ne-mobile-nav.is-open a:nth-child(5),
	.ne-mobile-nav.is-open .ne-mobile-nav__link:nth-child(5),
	.ne-mobile-nav.is-open button:nth-child(5) { animation-delay: 0.15s; }
	.ne-mobile-nav.is-open a:nth-child(6),
	.ne-mobile-nav.is-open .ne-mobile-nav__link:nth-child(6),
	.ne-mobile-nav.is-open button:nth-child(6) { animation-delay: 0.18s; }
	.ne-mobile-nav.is-open a:nth-child(7),
	.ne-mobile-nav.is-open .ne-mobile-nav__link:nth-child(7),
	.ne-mobile-nav.is-open button:nth-child(7) { animation-delay: 0.21s; }
}
@keyframes ne-nav-item-in {
	from { opacity: 0; transform: translateX(-8px); }
	to { opacity: 1; transform: translateX(0); }
}

/* Footer */
.ne-footer {
	border-top: 1px solid rgba(255, 255, 255, 0.04);
	background: linear-gradient(180deg, transparent, rgba(10, 15, 22, 0.5));
}
.ne-footer__link {
	transition: color 0.2s ease;
}
.ne-footer__link:hover {
	color: var(--ne-cyan);
}
.ne-footer__status-dot {
	animation: ne-pulse 2.5s ease infinite;
}

/* AI panel output spacing */
.ne-ai-panel__output {
	scroll-behavior: smooth;
}
.ne-terminal__ai-block + .ne-chat-user,
.ne-chat-user + .ne-terminal__ai-block {
	margin-top: 0.25rem;
}

/* Readiness deck */
.ne-readiness__option {
	transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.ne-readiness__option:hover {
	transform: translateX(4px);
}
.ne-readiness__option:active {
	transform: translateX(2px) scale(0.99);
}

/* Deck AI form focus */
.ne-deck__form:focus-within,
.ne-hero-ai__form:focus-within,
.ne-ai-panel__form:focus-within {
	border-color: rgba(0, 229, 255, 0.35);
	box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Deck stream placeholder */
.ne-deck__stream-placeholder {
	opacity: 0.55;
	transition: opacity 0.3s ease;
}
.ne-deck__stream:has(.ne-terminal__line) .ne-deck__stream-placeholder,
.ne-deck__stream:has(.ne-terminal__ai-block) .ne-deck__stream-placeholder {
	display: none;
}

/* FAB polish */
.ne-ai-fab {
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.25s ease;
}
.ne-ai-fab:focus-visible {
	outline: 2px solid rgba(0, 229, 255, 0.55);
	outline-offset: 3px;
}
.ne-ai-fab:active {
	transform: scale(0.96);
}

/* Skip link */
.ne-skip-link:focus {
	position: fixed;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 2000;
	padding: 0.5rem 1rem;
	background: var(--ne-surface);
	border: 1px solid rgba(0, 229, 255, 0.35);
	border-radius: 8px;
	color: var(--ne-cyan);
	font-family: var(--ne-mono);
	font-size: 0.75rem;
	text-decoration: none;
}

/* Graph intel close hover */
.ne-graph-intel__close {
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.ne-graph-intel__close:hover {
	border-color: rgba(0, 229, 255, 0.35);
	color: var(--ne-text);
	background: rgba(0, 229, 255, 0.08);
}

@media (max-width: 768px) {
	.ne-back-top {
		right: 1rem;
		bottom: 5rem;
	}
	.ne-toast-stack {
		left: 1rem;
		right: 1rem;
		max-width: none;
	}
}
