/* Telemetry band (header) + the Harivan Standard Time date control and its
   scrub HUD (ADR-019). Co-located with standard-time.js. */

.lk-header {
	flex: 0 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 9px 18px;
	border-bottom: 1px solid var(--border);
	background: linear-gradient(180deg, var(--amber-alpha-05), var(--transparent));
}

.lk-header-id {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.lk-title {
	font-size: 1.1rem;
	letter-spacing: 3px;
	color: var(--amber);
	font-weight: 600;
	text-shadow: 0 0 8px var(--amber-alpha-50);
	animation: lk-aberration 2.2s infinite;
}

.lk-header-sub {
	color: var(--muted);
	font-size: 0.66rem;
	letter-spacing: 1.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lk-telemetry {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.lk-tele {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.25;

	i {
		color: var(--muted);
		font-style: normal;
		font-size: 0.58rem;
		letter-spacing: 2px;
	}

	b {
		color: var(--text);
		font-weight: 600;
		font-size: 0.78rem;
		letter-spacing: 1px;

		&.ok {
			color: var(--green);
			text-shadow: 0 0 6px var(--green-alpha-40);
		}

		&.bad {
			color: var(--danger);
		}

		&.lk-bars {
			letter-spacing: 0;
			color: var(--amber);
		}
	}
}

/* The HST cell is the terminal's one date control (assets/standard-time.js): click
   it to type a date, or scroll the mouse wheel over a component to scrub it. It reads
   like the other telemetry values until hovered. */
.lk-hst-btn {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: var(--text);
	font-weight: 600;
	font-size: 0.78rem;
	letter-spacing: 1px;
	cursor: pointer;
	transition: color 0.15s ease, text-shadow 0.15s ease;

	&:hover,
	&:focus-visible {
		color: var(--amber);
		text-shadow: 0 0 6px var(--amber-alpha-40);
	}
}

/* Each date component (year/month/day) is its own scroll target: the pointer hovers
   one and the wheel tunes just that unit. The hovered component lights white so it's
   clear which one the wheel will move. */
.lk-hst-part {
	cursor: ns-resize;
	transition: color 0.12s ease, text-shadow 0.12s ease;
}

.lk-hst-part:hover {
	color: var(--text-bright);
	text-shadow: 0 0 6px var(--white-alpha-50);
}

.lk-hst-dot {
	color: var(--muted);
}

/* Per-digit flash on a scrub: only the digits that actually changed get .is-flash
   (assets/standard-time.js), so 03 → 04 lights just the "4". A quick white pulse
   that settles back to the inherited colour. */
.lk-hst-d {
	display: inline-block;
}

.lk-hst-d.is-flash {
	animation: hmb-hst-flash 0.45s ease-out;
}

@keyframes hmb-hst-flash {
	0% {
		color: var(--text-bright);
		text-shadow: 0 0 8px var(--white-alpha-90);
	}

	100% {
		color: inherit;
		text-shadow: none;
	}
}

/* The scrub HUD (assets/standard-time.js): a non-modal, overlay-styled panel
   pinned to the top edge that mirrors a giant copy of the date while the HST is
   scrubbed/hovered. It carries the same .lk-hst-part / .lk-hst-d markup as the
   cell, so the per-digit flash above drives it identically. pointer-events:none
   keeps it from blocking the map or page; the z-index clears the Star Map's
   fullscreen overlay (10000) and the command bar. Panel look matches
   assets/overlay/ (.lk-overlay): amber corner bracket + scanline wash. */
.lk-hst-hud {
	position: fixed;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	width: auto;
	height: auto;
	z-index: 10002;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.18s ease;

	&.is-visible {
		opacity: 1;
	}

	.lk-hst-hud-date {
		position: relative;
		display: block;
		background: color-mix(in srgb, var(--bg-panel), var(--overlay-transparent));
		border: 1px solid var(--amber-dim);
		box-shadow: 0 0 0 1px var(--overlay-shadow-border),
		0 6px 30px var(--overlay-shadow-drop),
		0 0 30px var(--overlay-shadow-glow);
		overflow: hidden;
		backdrop-filter: blur(5px);
		padding: 0.4em 0.9em;
		font-weight: 700;
		font-size: clamp(1.6rem, 4vw, 3rem);
		letter-spacing: 0.08em;
		color: var(--amber);
		text-shadow: 0 0 24px var(--amber-alpha-35);

		&::before {
			content: "";
			position: absolute;
			top: -1px;
			left: -1px;
			width: 10px;
			height: 10px;
			border-top: 2px solid var(--amber);
			border-left: 2px solid var(--amber);
			pointer-events: none;
			z-index: 1;
		}

		&::after {
			content: "";
			position: absolute;
			inset: 0;
			background: var(--crt-surface-scan);
			pointer-events: none;
		}

		.lk-hst-dot {
			color: var(--muted);
		}
	}
}

/* Narrow screens: the header wraps and the telemetry values tighten up,
   matching .lk-screen's mobile layout in terminal.css. */
@media (max-width: 720px) {
	.lk-header {
		flex-wrap: wrap;
	}

	.lk-telemetry {
		gap: 12px;
	}
}
