/* Solar system (orrery) filling the home page's main area, between the header and footer. */
.orrery-main,
.orrery-page {
	display: flex;
	flex-direction: column;
}
.orrery-page { flex: 1; }

/* Solar system (orrery) embedded on the home page. Adapted from the standalone full-screen version:
   everything is scoped to .orrery, and the canvas and control bar are positioned inside the box instead of the viewport.
   The scene's background is the page's background color. */
.orrery {
	--ink: #e9ecf6;
	--dim: #8b93b3;
	--line: rgba(160, 172, 220, 0.18);
	--panel: rgba(14, 19, 40, 0.72);
	/* controls are styled like the header's buttons and use the site's font (--font-body) and colors */
	position: relative;
	flex: 1;
	min-height: 200px;    /* low enough for phones held sideways, so the scene fits below the header without scrolling */
	overflow: hidden;
	background: var(--bg);    /* the page's background color (follows the light / dark theme) */
	color: var(--ink);
	color-scheme: dark;
	-webkit-font-smoothing: antialiased;
}
.orrery *, .orrery *::before, .orrery *::after { box-sizing: border-box; }
.orrery [hidden] { display: none !important; }

.orrery .stage { position: absolute; inset: 0; }
.orrery canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.orrery canvas.dragging { cursor: grabbing; }
.orrery canvas.hovering { cursor: pointer; }

/* Title at the top left; uses the site's h1 font and heading color. Clicks and drags pass through to the canvas. */
.orrery .orrery-title {
	position: absolute; top: 20px; left: var(--gutter); right: var(--gutter); z-index: 1; margin: 0;
	font-size: 1.5rem; text-align: left;    /* left edge lines up with the header's logo */
	pointer-events: none;
}

.orrery .hud { position: absolute; left: 0; right: 0; pointer-events: none; padding-inline: 16px; }
.orrery .hud > * { pointer-events: auto; }
.orrery .bottom { bottom: 0; padding-bottom: 18px; display: flex; justify-content: center; }

.orrery .bar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
	border-radius: 999px; padding: 8px 10px;

	/* same background, blur and border as the site header (follows the light / dark theme) */
	background: color-mix(in srgb, var(--bg) 85%, transparent); border: 1px solid var(--border);
	backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
	max-width: 100%;
}
/* Like the header's icon buttons: no border, primary text, a soft background and secondary text on hover */
.orrery .bar button {
	font: 600 0.95rem/1 var(--font-body);    /* same as the header links */ color: var(--primary); background: transparent;
	border: 0; border-radius: 999px; padding: 0.6rem 0.9rem; cursor: pointer; margin: 0;
}
.orrery .bar button:hover { background: var(--bg-alt); color: var(--secondary-text); }
.orrery .bar button[aria-pressed="true"] { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* Play / Pause works like the Labels toggle: tinted while the animation is running (aria-pressed, set by main.js), plain when paused */
.orrery .bar button.play { min-width: 74px; }
.orrery .speed { display: flex; align-items: center; gap: 10px; font: 0.8rem var(--font-body); color: var(--text-muted); margin: 0; }
.orrery .speed output { font-family: var(--font-body); color: var(--text); min-width: 10ch; font-variant-numeric: tabular-nums; }
.orrery input[type="range"] { width: 130px; accent-color: var(--primary); margin: 0; }
.orrery .bar button.hide { color: var(--text-muted); }
.orrery .bar button.hide:hover { color: var(--secondary-text); }

/* Same look as the control bar's buttons: no border, primary text, a soft background and secondary text on hover */
.orrery .show-hud {
	font: 600 0.95rem/1 var(--font-body);    /* same as the header links */ color: var(--primary); background: transparent;
	border: 0; border-radius: 999px; padding: 0.6rem 0.9rem; cursor: pointer; margin: 0;
}
.orrery .show-hud:hover { background: var(--bg-alt); color: var(--secondary-text); }
.orrery button:focus-visible, .orrery input:focus-visible, .orrery canvas:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.orrery canvas:focus-visible { outline-offset: -2px; }

/* Before main.js has run (it adds .hud-ready), show the controls' default state so they don't flash:
   the bar on desktop, just the Controls button on phones (narrow or touch-only screens). Matches isMobile in main.js. */
.orrery:not(.hud-ready) .show-hud { display: none; }
@media (max-width: 560px), (hover: none) and (pointer: coarse) {
	.orrery:not(.hud-ready) .bar { display: none; }
	.orrery:not(.hud-ready) .show-hud { display: inline-block; }
}

@media (max-width: 560px) {
	.orrery .orrery-title { top: 14px; }
	.orrery .bar { border-radius: 18px; }
	.orrery .bar { gap: 8px 10px; }
	.orrery input[type="range"] { width: 90px; }
	.orrery .speed output { min-width: 0; }
}
