/* DEAD AIR chassis: user-preference fallbacks (BRIEF §7, §8). Load after dial.css and static.css.
   No scroll-driven animations / no style queries need nothing here: those paths are the base
   styles (needle at --tune, attribute skins, frozen noisy trace). This file handles
   prefers-contrast: more and forced colors. */

@layer chassis {
	/* The page-swap frame goes flat grey. */
	@media (prefers-contrast: more), (forced-colors: active) {
		:root {
			--grain: none;
		}
	}

	/* More contrast: textures, grain, scanlines and glows off; hairlines become solid. */
	@media (prefers-contrast: more) {
		.dial__skin {
			background: var(--st-bg);
			border-color: var(--st-ink);
		}

		.dial__readout {
			border-color: var(--st-ink);
		}

		.dial__freq,
		.dial__needle,
		.dial__marker::after,
		.dial__hint {
			text-shadow: none;
			box-shadow: none;
		}

		.dial__scale,
		.dial__mhz {
			color: var(--st-ink);
		}

		.dial__marker::after,
		.dial__hint {
			border-color: var(--st-ink);
		}

		.static__noise {
			display: none;
		}
	}

	/* Forced colors: system colours only. Gradients are dropped by the UA, so the parts that
	   carry meaning (ticks, needle, the lit marker) opt out and paint in system colours. */
	@media (forced-colors: active) {
		.dial__skin {
			background: Canvas;
			color: CanvasText;
			border-color: CanvasText;
		}

		.dial__readout {
			border-color: CanvasText;
		}

		.dial__freq,
		.dial__unit,
		.dial__now {
			color: CanvasText;
		}

		.dial__scale {
			forced-color-adjust: none;
			color: CanvasText;
		}

		.dial__needle {
			forced-color-adjust: none;
			background: Highlight;
			box-shadow: none;
		}

		.dial__marker {
			color: LinkText;
		}

		.dial__marker::before {
			forced-color-adjust: none;
			background: LinkText;
		}

		.dial__marker[aria-current] .dial__label {
			text-decoration: underline 2px;
			text-underline-offset: 3px;
		}

		.dial__marker::after,
		.dial__hint {
			color: CanvasText;
			background: Canvas;
			border-color: CanvasText;
		}

		.static {
			border-block: 1px solid CanvasText;
		}

		.static__noise {
			display: none;
		}

		/* The trace still reads as a signal line, in system ink. */
		.static__scope,
		.static__echo,
		.static::after {
			forced-color-adjust: none;
			background: CanvasText;
		}

		.dial__keys {
			color: CanvasText;
			background: Canvas;
			border-color: CanvasText;
		}
	}
}
