:root {
	--bg: #0a0e15;
	--ink: #f4ecdc;
	--ink-dim: rgba(244, 236, 220, 0.62);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
	--dock: 100px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
#map.pointing { cursor: pointer; }

.brand { position: fixed; top: 22px; left: 28px; pointer-events: none; }
.brand h1 { margin: 0; font: 600 21px/1.1 var(--serif); }
.brand p { margin: 5px 0 0; font: 13px/1.3 var(--sans); color: var(--ink-dim); }

.nav { position: fixed; top: 22px; right: 24px; display: flex; gap: 6px; }
.nav button {
	height: 32px; min-width: 32px; padding: 0 11px; border-radius: 2px;
	background: #10151e; border: 1px solid rgba(244, 236, 220, 0.3);
	font-size: 13px;
}
.nav button:hover { border-color: rgba(244, 236, 220, 0.6); }
/* A checkbox, so Follow history reads as on or off at a glance. */
#follow { display: flex; align-items: center; gap: 7px; }
#follow::before { content: ""; width: 9px; height: 9px; border: 1px solid var(--ink-dim); }
#follow.on::before { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 2px #10151e; }
#zoom-in, #zoom-out { font-size: 19px; line-height: 1; padding: 0; }

.readout { position: fixed; left: 30px; bottom: calc(var(--dock) + 14px); pointer-events: none; }
#era-name { font: italic 17px/1 var(--serif); color: var(--ink-dim); margin: 0 0 2px 4px; }
.readout .year { font-family: var(--serif); line-height: 0.9; font-variant-numeric: lining-nums tabular-nums; }
#year-num { font-size: 86px; font-weight: 500; letter-spacing: -0.01em; }
#year-era { font-size: 30px; margin-left: 10px; color: var(--ink-dim); }

.dock {
	position: fixed; left: 0; right: 0; bottom: 0; height: var(--dock);
	display: flex; align-items: center; gap: 16px; padding: 0 24px 0 24px;
	background: var(--bg); border-top: 1px solid rgba(244, 236, 220, 0.16);
}
#play {
	flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0;
	background: var(--ink); color: #10141c; display: grid; place-items: center;
}
#play:hover { background: #fff; }
#play svg { width: 26px; height: 26px; fill: currentColor; }
.speed { flex: none; display: flex; flex-direction: column; gap: 6px; }
.speed-label { font-size: 12px; color: var(--ink-dim); }
.speed-buttons { display: flex; border: 1px solid rgba(244, 236, 220, 0.3); border-radius: 2px; overflow: hidden; }
.speed-buttons button { background: none; border: 0; padding: 5px 9px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-dim); }
.speed-buttons button.on { background: rgba(244, 236, 220, 0.9); color: #10141c; font-weight: 600; }
#strip { flex: 1; height: 76px; margin-top: 8px; min-width: 0; cursor: pointer; touch-action: none; }

.credit { position: fixed; right: 28px; bottom: calc(var(--dock) + 6px); margin: 0; font-size: 11px; color: rgba(244, 236, 220, 0.5); }
.credit a { text-decoration: none; border-bottom: 1px solid rgba(244, 236, 220, 0.25); }

#panel {
	position: fixed; top: 76px; right: 24px; width: 380px; max-height: calc(100% - var(--dock) - 110px); overflow: auto;
	padding: 22px 26px 24px; border-radius: 2px;
	background: #10151e; border: 1px solid rgba(244, 236, 220, 0.3);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	transform: translateX(calc(100% + 40px)); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#panel.open { transform: none; }
#panel-close { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 2px; background: none; font-size: 22px; color: var(--ink-dim); }
#panel-close:hover { background: rgba(244, 236, 220, 0.1); }
#panel-eyebrow { font-size: 13px; color: var(--ink-dim); }
#panel-eyebrow::first-letter { text-transform: uppercase; }
#panel-title { margin: 6px 0 4px; font: 600 26px/1.15 var(--serif); }
#panel-dates { font: 15px/1.4 var(--sans); color: var(--ink-dim); }
#panel-blurb { margin: 14px 0 18px; padding-top: 14px; border-top: 1px solid rgba(244, 236, 220, 0.16); font: 16.5px/1.55 var(--serif); }
#panel-blurb:empty { display: none; }
#panel-link { font-size: 14px; color: var(--ink); text-underline-offset: 3px; text-decoration-color: rgba(244, 236, 220, 0.45); }
#panel-link:hover { text-decoration-color: var(--ink); }

#loading {
	position: fixed; inset: 0; display: grid; place-items: center; font: 18px var(--serif); color: var(--ink-dim);
	background: var(--bg); transition: opacity 0.5s;
}
#loading.done { opacity: 0; pointer-events: none; }

/* Invisible buttons over the canvas's dots and names, for the keyboard; only the focus ring shows. */
#keys { position: fixed; inset: 0; pointer-events: none; }
.key { position: absolute; left: 0; top: 0; padding: 0; border: 0; border-radius: 2px; background: none; pointer-events: none; }
.key:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
