:root {
  --night: #1f140c;
  --night-2: #2c1d11;
  --rule: #6b5233;
  --vellum: #ebd6ac;
  --vellum-dim: #d9be8e;
  --gold: #f0c987;
  --ink: #2b1a0e;
  --sea-ink: #4a3018;
  --blood: #7a1f12;
  --display: 'IM Fell English SC', Georgia, serif;
  --text: 'IM Fell English', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--night); color: var(--vellum); font: 18px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--vellum); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
p { margin: 0; }

.top, .foot { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: baseline; padding: 1rem clamp(1rem, 4vw, 2.75rem); }
.top { border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--display); font-size: 1.5rem; text-decoration: none; color: var(--gold); }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.top nav a { text-decoration: none; padding: .55rem 0; font-family: var(--display); font-size: 1.1rem; }
.top nav a[aria-current] { color: var(--gold); border-bottom: 1px solid var(--gold); }
.foot { border-top: 1px solid var(--rule); color: var(--vellum-dim); font-style: italic; font-size: .95rem; margin-top: 2.5rem; }
main { padding: 1.5rem clamp(1rem, 4vw, 2.75rem) 0; }

.hero { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; justify-content: space-between; align-items: baseline; margin-bottom: 1.25rem; }
.hero.tight { display: block; }
.sub, .aside, .crumb, .kind, .hint { font-style: italic; color: var(--vellum-dim); }
.crumb, .kind, .hint, .aside { font-size: .95rem; }
.split { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.lead { font-size: 1.2rem; }

.btn { display: inline-block; background: var(--vellum); color: var(--night); text-decoration: none; font-family: var(--display); font-size: 1.15rem; padding: .7rem 1.3rem; border: 1px solid var(--vellum); }
.btn:hover { background: #fff; color: var(--night); }
.btn.ghost { background: transparent; color: var(--vellum); }
.btn.ghost:hover { background: var(--night-2); color: #fff; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

/* labels drawn over the parchment art */
.lb { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; text-align: center; line-height: 1.05; color: var(--ink); text-decoration: none; text-shadow: 0 0 2px var(--vellum), 0 0 2px var(--vellum), 0 0 4px var(--vellum), 0 0 8px var(--vellum); }
a.lb:hover, button.lb:hover { color: var(--blood); text-decoration: underline; }

/* cosmology */
.chart { flex: 999 1 520px; min-width: 0; max-width: 760px; aspect-ratio: 1 / 1; position: relative; container-type: inline-size; border: 2px solid #3a2212; }
.chart img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart .fc { font-family: var(--display); font-size: 3.6cqw; letter-spacing: .12em; }
.chart .ct { font-family: var(--display); font-size: 1.75cqw; }
.chart .rl { font-family: var(--display); font-size: 2.05cqw; padding: .7cqw 1cqw; }
.chart .rl.un { font-family: var(--text); font-style: italic; }
.legend { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.force { border-top: 1px solid var(--rule); padding-top: .75rem; }
.force h2 { font-size: 1.4rem; color: var(--gold); }
.legend .aside { border-top: 1px solid var(--rule); padding-top: .75rem; }

/* world map */
.map-wrap { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: .6rem; }
.map-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end; }
.map-tools .hint { margin-right: auto; }
.map-tools button { background: var(--vellum); color: var(--night); border: 0; font-family: var(--display); font-size: 1.3rem; min-width: 46px; min-height: 46px; padding: 0 .9rem; cursor: pointer; }
.map-tools button:hover { background: #fff; }
#zreset { font-size: 1.05rem; }
#map { aspect-ratio: 16 / 10; position: relative; overflow: hidden; container-type: inline-size; border: 2px solid #3a2212; background: #d2b083; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#map.dragging { cursor: grabbing; }
#layer { position: absolute; inset: 0; transform-origin: 0 0; }
#layer img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#map .mj { font-family: var(--display); font-size: 2.15cqw; letter-spacing: .06em; background: none; border: 0; padding: .5cqw .8cqw; cursor: pointer; }
#map .mj[aria-pressed="true"] { color: var(--blood); text-decoration: underline; }
#map .se { font-style: italic; font-size: 1.35cqw; color: var(--sea-ink); pointer-events: none; }
#map .mn { font-size: .98cqw; pointer-events: none; opacity: 0; transition: opacity .25s; }
#map.detail .mn { opacity: 1; }
.panel { flex: 1 1 280px; min-width: 0; border: 1px solid var(--rule); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.panel h2 { font-size: 1.7rem; color: var(--gold); }
.panel h3 { font-size: 1rem; font-family: var(--text); font-style: italic; color: var(--vellum-dim); margin-top: .6rem; }
.panel ul { margin: 0; padding: 0; list-style: none; }
#p-facts { color: var(--vellum-dim); font-size: .95rem; }
.sail button { display: block; width: 100%; text-align: left; background: transparent; color: var(--vellum); border: 0; border-top: 1px solid #4a3823; font-family: var(--display); font-size: 1.1rem; padding: .65rem .25rem; min-height: 44px; cursor: pointer; }
.sail button:hover { color: #fff; background: var(--night-2); }

/* reading pages */
.page { max-width: 44rem; margin: 0 auto; display: flex; flex-direction: column; gap: .9rem; }
.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.facts li { border: 1px solid var(--rule); padding: .3rem .7rem; font-size: .95rem; color: var(--vellum-dim); }
.page h2 { font-size: 1.4rem; color: var(--gold); margin-top: .75rem; }
.places { margin: 0; }
.places dt { font-family: var(--display); font-size: 1.2rem; border-top: 1px solid var(--rule); padding-top: .7rem; margin-top: .7rem; }
.places dd { margin: .2rem 0 0; }
.pager { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1rem; font-family: var(--display); }
.pager a { text-decoration: none; padding: .5rem 0; }
.job { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; border-top: 1px solid var(--rule); padding-top: .9rem; }
.job .when { flex: 0 0 8.5rem; font-style: italic; color: var(--vellum-dim); }
.job > div { flex: 1 1 20rem; min-width: 0; }
.job h2 { margin: 0; font-size: 1.3rem; }
.job .org { color: var(--vellum-dim); }
.job ul { margin: .4rem 0 0; padding-left: 1.1rem; }

@media (prefers-reduced-motion: reduce) { #map .mn { transition: none; } }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .top, .foot, .cta, .crumb { display: none; }
  a { color: #000; }
  .page h2, .job .when, .job .org, .facts li { color: #000; }
  .facts li, .job { border-color: #999; }
}

/* The Palimpsest */
.year-form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: end;
  border: 1px solid var(--rule);
  padding: 1.1rem 1.25rem;
}
.year-form label {
  font-family: var(--display);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.year-form input[type="number"] {
  background: var(--night-2);
  color: var(--vellum);
  border: 1px solid var(--rule);
  font-family: var(--text);
  font-size: 1.2rem;
  padding: .5rem .7rem;
  width: 8rem;
}
.year-form button {
  cursor: pointer;
  font: inherit;
}
#palimpsest-status { min-height: 1.5em; }
#ledger { display: flex; flex-direction: column; gap: 1.25rem; }
.entry {
  border-top: 1px solid var(--rule);
  padding-top: .9rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.entry[hidden] { display: none; }
.entry .when { font-style: italic; color: var(--vellum-dim); }
.entry h2 { font-size: 1.4rem; color: var(--gold); }
.entry dl { margin: 0; }
.entry dt {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--vellum-dim);
}
.entry dd { margin: .15rem 0 .55rem; }
.entry .source { font-size: .95rem; }
.entry .source a { color: var(--gold); }
@media print {
  .year-form { display: none; }
  .entry { border-color: #999; }
  .entry h2, .entry .when, .entry dt { color: #000; }
  .entry .source a { color: #000; }
}
