@font-face {
  font-family: 'Atlas Running';
  src: url('./fonts/atlas-running.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atlas Kai';
  src: url('./fonts/atlas-kai.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atlas Display';
  src: url('./fonts/atlas-display.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  color: var(--atlas-paper);
  background: var(--atlas-night);
  font: 15px/1.7 var(--atlas-body-font);
  -webkit-font-smoothing: antialiased;
}
#experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}
#map {
  position: absolute;
  inset: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
a,
summary {
  touch-action: manipulation;
}
:where(button, a, input, select, summary):focus-visible {
  outline: 2px solid var(--atlas-focus);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.vignette {
  position: absolute;
  z-index: var(--atlas-z-atmosphere);
  inset: 0;
  pointer-events: none;
  background: radial-gradient(115% 92% at 50% 44%, transparent 58%, rgb(3 5 9 / 42%) 100%);
}
.masthead {
  position: absolute;
  z-index: var(--atlas-z-controls);
  inset: 0 0 auto;
  height: 76px;
  padding: 0 var(--atlas-edge);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.masthead::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 150px;
  background: linear-gradient(180deg, rgb(3 5 9 / 68%), rgb(3 5 9 / 26%) 58%, transparent);
  pointer-events: none;
}
.brand {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  font: 400 26px/1.2 var(--atlas-hero-font);
  letter-spacing: 7px;
  text-shadow:
    0 1px 2px rgb(3 5 9 / 60%),
    0 4px 18px rgb(3 5 9 / 45%);
}
.brand small {
  display: block;
  margin-top: 5px;
  font: 10px/1.3 var(--atlas-body-font);
  letter-spacing: 3px;
  color: var(--atlas-muted);
}
.seal-mark {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 35%));
}
.global-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.global-tools .icon-button {
  background: var(--atlas-glass);
  border: 1px solid var(--atlas-glass-line);
  backdrop-filter: blur(12px);
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--atlas-radius-control);
  background: transparent;
  color: var(--atlas-paper);
}
button:hover:not(:disabled),
summary:hover {
  background-color: var(--atlas-hover);
}
button:active:not(:disabled) {
  transform: scale(0.97);
}
#sound[aria-pressed='true'] {
  color: var(--atlas-brass);
  border-color: color-mix(in srgb, var(--atlas-brass) 55%, transparent);
}
.icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}
.era-panel,
.era-title,
.timeline {
  opacity: calc(1 - var(--browse-mix, 0));
}
body[data-browse='close'] .era-panel,
body[data-browse='close'] .era-title,
body[data-browse='close'] .timeline {
  pointer-events: none;
}
.flight-controls,
.place-caption {
  opacity: var(--browse-mix, 0);
}
body[data-browse='far'] .flight-controls,
body[data-browse='far'] .place-caption {
  visibility: hidden;
}
body[data-browse='near'] .flight-controls {
  pointer-events: none;
}
.era-panel {
  position: absolute;
  z-index: var(--atlas-z-controls);
  left: var(--atlas-edge);
  top: 108px;
  width: 300px;
  max-height: calc(100dvh - 374px);
  display: flex;
  background: var(--atlas-panel);
  border: 1px solid var(--atlas-faint-line);
  border-radius: var(--atlas-radius-panel);
  box-shadow: var(--atlas-shadow);
}
.era-panel[hidden] {
  display: none;
}
.era-scroll {
  min-height: 0;
  width: 100%;
  padding: 26px 28px 26px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--atlas-line) transparent;
  overscroll-behavior: contain;
}
/* The vertical dynasty inscription floats directly on the map, like a colophon. */
.era-title {
  position: absolute;
  z-index: var(--atlas-z-controls);
  left: calc(var(--atlas-edge) + 4px);
  top: 50%;
  margin: 0;
  transform: translateY(-53%);
}
.era-title-button {
  display: block;
  writing-mode: vertical-rl;
  padding: 14px 10px;
  background: transparent;
  border-radius: var(--atlas-radius-control);
  color: var(--atlas-paper);
}
#dynasty-name {
  display: block;
  font: 400 clamp(72px, 13vh, 120px) / 1.05 var(--atlas-hero-font);
  letter-spacing: 0.1em;
  text-shadow:
    0 1px 3px rgb(3 5 9 / 60%),
    0 6px 28px rgb(3 5 9 / 55%);
}
#dynasty-name[data-long='true'] {
  font-size: clamp(38px, 7vh, 54px);
  letter-spacing: 0.12em;
}
#dynasty-dates {
  display: block;
  margin-right: 14px;
  padding: 4px 12px 4px 0;
  border-right: 1px solid color-mix(in srgb, var(--atlas-brass) 45%, transparent);
  color: var(--atlas-brass);
  font: 400 15px/1.8 var(--atlas-hero-font);
  letter-spacing: 0.32em;
  text-shadow: 0 1px 2px rgb(3 5 9 / 75%);
}
.era-title-button:hover #dynasty-name,
.era-title-button:focus-visible #dynasty-name {
  color: #fff8e8;
}
.era-title-button:hover #dynasty-dates {
  border-right-color: var(--atlas-brass);
}
body[data-map-state='loading'] .era-title {
  opacity: 0.55;
}
.era-year {
  margin: 16px 0 22px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--atlas-muted);
  font-size: 12px;
  letter-spacing: 1px;
}
.era-year strong {
  font: 400 34px/1 var(--atlas-number-font);
  color: var(--atlas-paper);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.event-context {
  padding-top: 18px;
  border-top: 1px solid var(--atlas-faint-line);
}
#event-title {
  margin: 0 0 8px;
  font: 21px/1.6 var(--atlas-title-font);
  letter-spacing: 1px;
}
#era-description {
  margin: 0;
  color: var(--atlas-muted);
  font-size: 15px;
  line-height: 2;
}
.map-year {
  color: var(--atlas-muted);
  margin: 18px 0 7px;
  font-size: 13px;
  line-height: 1.8;
}
.map-provenance summary {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  list-style: none;
  color: var(--atlas-brass);
  font-size: 13px;
  border-radius: 3px;
}
.map-provenance summary::-webkit-details-marker {
  display: none;
}
.map-provenance summary .icon {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}
.map-provenance[open] summary .icon {
  transform: rotate(90deg);
}
.map-uncertainty {
  margin: 10px 0;
  font-size: 14px;
  color: var(--atlas-muted);
  line-height: 1.9;
}
.source-links {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 13px;
}
.display-settings {
  border-bottom: 1px solid var(--atlas-faint-line);
  padding: 14px 0 18px;
  margin-bottom: 20px;
}
.display-settings > summary {
  width: max-content;
  cursor: pointer;
  font: 18px/1.5 var(--atlas-title-font);
}
.display-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.display-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--atlas-field);
  border: 1px solid var(--atlas-faint-line);
  border-radius: var(--atlas-radius-control);
}
.display-option:is([aria-pressed='true'], [aria-expanded='true']) {
  color: var(--atlas-brass);
  border-color: var(--atlas-brass);
}
.display-settings .layer-panel {
  position: static;
  width: auto;
  margin-top: 16px;
  border-radius: var(--atlas-radius-panel);
  box-shadow: none;
}
.polity-card {
  position: absolute;
  z-index: var(--atlas-z-popover);
  width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 18px 20px 16px;
  border: 1px solid var(--atlas-faint-line);
  border-top: 3px solid var(--period-color, var(--atlas-brass));
  border-radius: var(--atlas-radius-panel);
  background: var(--atlas-panel-solid);
  color: var(--atlas-paper);
  box-shadow: var(--atlas-shadow);
  text-align: left;
}
.polity-note {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.85;
}
.polity-note h3 {
  margin: 16px 0 8px;
  font: 18px/1.4 var(--atlas-title-font);
  letter-spacing: 1px;
}
.polity-note p,
.polity-note ul {
  margin: 0 0 10px;
}
.polity-note li + li {
  margin-top: 8px;
}
.polity-note a {
  color: var(--atlas-brass);
}
.polity-note figure {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}
.polity-note img {
  width: 72px;
  height: 88px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--atlas-field);
}
.polity-note figcaption {
  color: var(--atlas-muted);
  font-size: 12px;
}
#polity-card-name {
  display: block;
  font: 22px/1.3 var(--atlas-title-font);
  letter-spacing: 2px;
}
#polity-card-summary,
#polity-card-years {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.85;
}
#polity-card-years {
  color: var(--atlas-muted);
}
#polity-card-source {
  display: inline-block;
  margin-top: 14px;
  color: var(--atlas-brass);
  font-size: 13px;
}
.map-controls {
  position: absolute;
  z-index: var(--atlas-z-controls);
  right: var(--atlas-edge);
  top: 104px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-group {
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: var(--atlas-glass);
  border: 1px solid var(--atlas-glass-line);
  border-radius: var(--atlas-radius-control);
  box-shadow: var(--atlas-shadow);
  backdrop-filter: blur(14px) saturate(1.15);
}
.tool-group button {
  position: relative;
}
.tool-group button[aria-pressed='true'],
.tool-group button[aria-expanded='true'] {
  color: var(--atlas-brass);
  background: var(--atlas-field);
}
.tool-group button + button {
  margin-top: 6px;
}
#face-north .icon {
  transform: rotate(var(--heading, 0deg));
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  pointer-events: none;
  position: absolute;
  right: calc(100% + 15px);
  padding: 5px 10px;
  background: var(--atlas-panel-solid);
  color: var(--atlas-paper);
  border: 1px solid var(--atlas-faint-line);
  border-radius: 4px;
  box-shadow: var(--atlas-shadow);
  white-space: nowrap;
  font: 11px/1.7 var(--atlas-body-font);
  opacity: 0;
  transform: translateX(4px);
}
[data-tooltip]:is(:hover, :focus-visible)::after {
  opacity: 1;
  transform: none;
}
.place-caption {
  position: absolute;
  z-index: var(--atlas-z-controls);
  right: var(--atlas-edge);
  bottom: var(--atlas-timeline-space);
  text-align: right;
  padding: 12px 16px;
  border: 1px solid var(--atlas-glass-line);
  border-radius: 8px;
  background: var(--atlas-glass);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.place-caption > span {
  display: block;
  font: 18px/1.4 var(--atlas-title-font);
}
.place-caption small {
  display: block;
  color: var(--atlas-muted);
  margin-top: 4px;
  font-size: 10px;
}
.flight-controls {
  position: absolute;
  z-index: var(--atlas-z-controls);
  left: 50%;
  bottom: calc(var(--atlas-timeline-space) + 10px);
  transform: translateX(-50%);
  width: 440px;
  max-width: calc(100% - 72px);
  padding: 14px 34px 12px;
  border: 0;
  border-radius: 1px;
  background:
    linear-gradient(
      90deg,
      rgb(0 0 0 / 28%),
      transparent 18px,
      transparent calc(100% - 18px),
      rgb(0 0 0 / 28%)
    ),
    linear-gradient(#3a3128, #2c261f 52%, #241f1a);
  color: #cbbba0;
  font-size: 11px;
  letter-spacing: 0.04em;
  box-shadow:
    0 16px 30px rgb(0 0 0 / 36%),
    inset 0 0 0 1px rgb(214 186 130 / 16%);
  pointer-events: none;
}
.flight-controls::before,
.flight-controls::after {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  width: 16px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 9px, #f0d7a2 0 5px, #8a6434 6px 7px, transparent 8px),
    radial-gradient(
      circle at 50% calc(100% - 9px),
      #f0d7a2 0 5px,
      #8a6434 6px 7px,
      transparent 8px
    ),
    linear-gradient(90deg, #4a2d18, #a8753e 38%, #e2c48a 50%, #8d5c30 64%, #3d2414);
  box-shadow:
    inset 0 0 0 1px rgb(255 232 190 / 28%),
    0 6px 10px rgb(20 12 4 / 28%);
}
.flight-controls::before {
  left: -7px;
}
.flight-controls::after {
  right: -7px;
}
.flight-instruments {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 9px;
  font-variant-numeric: tabular-nums;
}
.flight-location {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.flight-location output {
  font: 15px var(--atlas-number-font);
  font-variant-numeric: tabular-nums;
}
#modern-map-status {
  margin: 6px 0 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgb(232 214 176 / 16%);
  font-size: 10px;
}
body[data-basemap='error'] #modern-map-status {
  color: var(--atlas-brass);
}
.flight-location output,
.flight-instruments output,
.flight-instruments strong,
#flight-help kbd {
  color: #f3ead8;
}
.flight-instruments strong {
  font:
    400 18px/1 'Atlas Running',
    'Kaiti SC',
    'KaiTi',
    serif;
  letter-spacing: 3px;
}
#flight-help {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px;
}
#flight-help small {
  width: 100%;
  text-align: center;
  font-size: 10px;
}
.flight-reticle {
  display: none;
  position: absolute;
  z-index: var(--atlas-z-atmosphere);
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.65;
  filter: drop-shadow(0 1px 1px var(--atlas-label-ink));
}
body[data-flight='ready'] .flight-reticle,
body[data-flight='moving'] .flight-reticle {
  display: block;
}
.flight-reticle::before,
.flight-reticle::after {
  content: '';
  position: absolute;
  background: var(--atlas-label-paper);
}
.flight-reticle::before {
  top: 9px;
  left: 0;
  width: 20px;
  height: 1px;
}
.flight-reticle::after {
  left: 9px;
  top: 0;
  width: 1px;
  height: 20px;
}
body[data-flight='moving'] .flight-instruments strong {
  color: var(--atlas-brass);
}
body[data-focused='true'] .flight-controls {
  bottom: 32px;
}
body[data-browse='near'] .map-status,
body[data-browse='close'] .map-status {
  bottom: calc(var(--atlas-timeline-space) + 108px);
}
body:is([data-view='mountains'], [data-view='coast'])[data-timeline-mode='story'] .era-panel {
  max-height: calc(100dvh - var(--atlas-timeline-space) - 220px);
}
.map-status {
  position: absolute;
  z-index: var(--atlas-z-controls);
  left: 50%;
  bottom: var(--atlas-timeline-space);
  transform: translateX(-50%);
  max-width: 44%;
  padding: 6px 12px;
  background: var(--atlas-glass);
  border: 1px solid var(--atlas-glass-line);
  border-radius: 5px;
  backdrop-filter: blur(8px);
  color: var(--atlas-muted);
  font-size: 11px;
}
body[data-terrain='ready'][data-map-state='ready'] .map-status {
  opacity: 0;
  pointer-events: none;
}
body:not([data-renderer]) #map {
  background: linear-gradient(160deg, #05080c, #0d1822 58%, #081018);
}
.cesium-viewer-bottom {
  display: none;
}
.layer-panel {
  position: absolute;
  z-index: var(--atlas-z-popover);
  right: 90px;
  top: 105px;
  width: 288px;
  padding: 20px;
  background: var(--atlas-panel-solid);
  border: 1px solid var(--atlas-line);
  box-shadow: var(--atlas-shadow);
  border-radius: var(--atlas-radius-panel);
}
.layer-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 21px var(--atlas-title-font);
}
.layer-title button {
  height: 30px;
  width: 30px;
}
.layer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 5px;
  font-size: 12px;
}
.layer-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.layer-panel p,
.layer-panel a {
  font-size: 11px;
  color: var(--atlas-muted);
}
.layer-opacity {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 16px;
  font-size: 12px;
}
.layer-opacity input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 13px 0;
}
.layer-locate {
  padding: 8px 12px;
  background: var(--atlas-field);
  color: var(--atlas-paper);
  border-radius: var(--atlas-radius-control);
  font-size: 12px;
}
.overlay-caption {
  position: absolute;
  z-index: var(--atlas-z-controls);
  top: 89px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--atlas-panel-solid);
  color: var(--atlas-paper);
  font-size: 10px;
  max-width: 50%;
}
dialog {
  width: min(620px, calc(100vw - 48px));
  max-height: 85dvh;
  padding: 30px 36px;
  border: 1px solid var(--atlas-faint-line);
  border-radius: var(--atlas-radius-panel);
  background: var(--atlas-panel-solid);
  color: var(--atlas-paper);
  box-shadow: var(--atlas-shadow);
  font-size: 13px;
  scrollbar-width: thin;
}
dialog::backdrop {
  background: rgb(3 5 9 / 58%);
  backdrop-filter: blur(6px);
}
.dialog-top {
  position: sticky;
  top: -30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--atlas-panel-solid);
  padding: 8px 0 16px;
}
dialog h2 {
  margin: 0;
  font: 400 28px/1.5 var(--atlas-title-font);
  letter-spacing: 3px;
}
dialog h3 {
  font: 20px/1.5 var(--atlas-title-font);
  letter-spacing: 2px;
  margin: 26px 0 8px;
}
dialog p {
  color: var(--atlas-muted);
  line-height: 1.9;
}
dialog a {
  color: var(--atlas-paper);
}
.volume-label {
  display: flex;
  align-items: center;
  gap: 20px;
}
.reading-open {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 18px 0 6px;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--atlas-faint-line);
  border-bottom: 1px solid var(--atlas-faint-line);
  border-radius: 0;
  background: transparent;
  color: var(--atlas-paper);
  font-size: 14px;
  letter-spacing: 1px;
  text-align: left;
}
.reading-open .icon:last-child {
  margin-left: auto;
  width: 14px;
}
.reading-dialog {
  width: min(760px, 90vw);
  padding: 24px 36px 28px;
  overscroll-behavior: contain;
}
.reading-top {
  top: -24px;
  z-index: 1;
  border-bottom: 1px solid var(--atlas-faint-line);
}
.reading-picker,
.reading-actions,
.reading-people-heading,
.reading-filter {
  display: flex;
  align-items: center;
  gap: 14px;
}
.reading-picker label,
.reading-filter,
.reading-dates,
#reading-count {
  color: var(--atlas-muted);
  font-size: 11px;
  font-weight: 400;
}
.reading-picker select,
.reading-filter input {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius-control);
  background: var(--atlas-field);
  color: var(--atlas-paper);
  font: inherit;
}
.reading-picker select {
  min-width: 160px;
  font-size: 12px;
}
.reading-intro {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--atlas-faint-line);
}
.reading-intro .reading-dates {
  margin: 0 0 5px;
  letter-spacing: 0.06em;
}
.reading-intro h2 {
  font-size: 34px;
  letter-spacing: 0.08em;
}
#reading-summary {
  max-width: 58ch;
  margin: 10px 0 18px;
  font-size: 14px;
  line-height: 1.95;
}
.reading-actions {
  justify-content: space-between;
}
.reading-actions a {
  color: var(--atlas-brass);
  text-underline-offset: 5px;
}
.reading-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--atlas-paper);
  background: var(--atlas-field);
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius-control);
}
.reading-actions button:hover {
  background: var(--atlas-hover);
}
.reading-polities,
.reading-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}
.reading-polity,
.reading-person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--atlas-faint-line);
  text-decoration: none;
  transition: background 140ms ease;
}
.reading-polity:hover,
.reading-person:hover {
  background: var(--atlas-hover);
}
.reading-person strong {
  font-family: var(--atlas-title-font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.08em;
}
.reading-polity strong {
  font: 20px/1.5 var(--atlas-title-font);
  letter-spacing: 0.04em;
}
.reading-arrow {
  color: var(--atlas-brass);
  font-size: 15px;
}
.reading-description {
  grid-column: 1 / -1;
  color: var(--atlas-muted);
  font-size: 15px;
  line-height: 1.8;
}
.reading-people-heading {
  justify-content: space-between;
  margin: 20px 0 4px;
}
.reading-people-heading h3 {
  margin: 0;
}
#reading-count {
  margin-left: 6px;
}
.reading-filter {
  gap: 8px;
}
.reading-filter input {
  width: 160px;
  font-size: 12px;
}
.reading-footnote {
  margin-top: 26px;
  font-size: 11px;
}
.reading-footnote p {
  margin: 0 0 8px;
}
input[type='range'],
input[type='checkbox'] {
  accent-color: var(--atlas-brass);
}
#error {
  position: absolute;
  z-index: var(--atlas-z-popover);
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 20px;
  width: max-content;
  max-width: 70vw;
  background: var(--atlas-panel-solid);
  border: 1px solid var(--atlas-brass);
  color: var(--atlas-paper);
  border-radius: 8px;
  box-shadow: var(--atlas-shadow);
}
body[data-focused='true'] .era-panel,
body[data-focused='true'] .era-title,
body[data-focused='true'] .timeline,
body[data-focused='true'] .place-caption {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}
/* The inscription fades in place; the 8px settle would cancel its vertical centering. */
body[data-focused='true'] .era-title {
  transform: translateY(-53%);
}
@media (max-width: 1120px) {
  :root {
    --atlas-edge: 22px;
  }
  .masthead {
    gap: 12px;
  }
  .global-tools {
    gap: 3px;
  }
  .era-panel {
    width: 262px;
  }
  .era-scroll {
    padding-inline: 20px;
  }
}
@media (max-height: 760px) and (min-width: 768px) {
  .era-panel {
    top: 99px;
    max-height: calc(100dvh - 354px);
  }
  .era-scroll {
    padding: 17px 22px;
  }
  #dynasty-name {
    font-size: clamp(54px, 11vh, 84px);
  }
  .era-year {
    margin: 12px 0 15px;
  }
  .era-year strong {
    font-size: 29px;
  }
  .event-context {
    padding-top: 13px;
  }
  .map-year {
    margin-top: 13px;
  }
  .map-controls {
    top: 99px;
  }
  .tool-group {
    flex-direction: row;
  }
  .tool-group button + button {
    margin: 0 0 0 3px;
  }
}
/* Basic containment only; mobile product adaptation is outside this iteration. */
@media (max-width: 767px) {
  :root {
    --atlas-edge: 12px;
  }
  .masthead {
    height: 76px;
    grid-template-columns: 1fr auto;
    padding-block: 0;
  }
  .era-panel {
    top: 108px;
    width: 214px;
    max-height: calc(100dvh - 440px);
  }
  .era-title {
    top: 92px;
    left: var(--atlas-edge);
    transform: none;
  }
  body[data-focused='true'] .era-title {
    transform: none;
  }
  #dynasty-name {
    font-size: 48px;
  }
  #dynasty-name[data-long='true'] {
    font-size: 30px;
  }
  #dynasty-dates {
    font-size: 12px;
    letter-spacing: 0.22em;
  }
  .map-controls {
    top: 108px;
  }
  .place-caption {
    display: none;
  }
  .layer-panel {
    top: 134px;
    right: 65px;
    width: min(280px, calc(100vw - 85px));
  }
}
@media (prefers-reduced-transparency: reduce) {
  .masthead,
  .timeline,
  .tool-group,
  .place-caption,
  .map-status,
  .global-tools .icon-button {
    background: var(--atlas-panel-solid);
    backdrop-filter: none;
  }
  dialog::backdrop {
    backdrop-filter: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a,
  summary,
  [data-tooltip]::after,
  .era-panel,
  .era-title,
  .timeline,
  .place-caption {
    transition:
      transform 200ms var(--ease-standard),
      opacity 200ms var(--ease-standard),
      visibility 200ms;
  }
  body:not([data-intro]) .era-panel {
    animation: enter-atlas 550ms var(--ease-standard) backwards;
  }
  body:not([data-intro]) .timeline {
    animation: enter-atlas 650ms 80ms var(--ease-standard) backwards;
  }
  @keyframes enter-atlas {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  /* The opening flight hides the chrome, then lands it in one staged reveal. */
  body[data-intro='playing'] :is(.masthead, .era-title, .map-controls, .timeline, .map-status) {
    opacity: 0;
    visibility: hidden;
  }
  body[data-intro='revealed'] :is(.masthead, .era-title, .map-controls, .timeline) {
    animation: chrome-arrive 900ms var(--ease-standard) backwards;
  }
  body[data-intro='revealed'] .masthead {
    animation-delay: 240ms;
  }
  body[data-intro='revealed'] .map-controls {
    animation-delay: 380ms;
  }
  body[data-intro='revealed'] .timeline {
    animation-delay: 520ms;
  }
  @keyframes chrome-arrive {
    from {
      opacity: 0;
      filter: blur(12px);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
