/* The same night sky runs through the atlas, the village and the game chapters. */
:root {
  --silver: #d6eaff;
  --moon-gold: #efcf9f;
}
.chapter { position: relative; isolation: isolate; }
.chapter p strong { color: var(--moon-gold); }
.chapter h2 { font-weight: 400; }
.chapter .intro { text-wrap: balance; }
.chapter-heading { position: relative; }
.chapter-heading .section-index { color: #b4d6f2; }
.mobile-index { display: none; }

/* Chapter index */
.rail { z-index: 2; }
.rail-inner { top: calc(var(--head) + 22px); padding: 25px 0 30px; }
.rail-label {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 24px;
  color: #e2f0fc;
  font: 25px/1.15 var(--serif);
  letter-spacing: -.035em;
  text-transform: none;
}
.index-compass {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  color: #c7e9ff;
  border: 1px solid #557c96;
  border-radius: 50%;
  background: radial-gradient(circle, #264965, #0d1928 70%);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px #263c50;
}
.index-compass::before, .index-compass::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: #afcfe5;
  transform: rotate(45deg);
}
.index-compass::before { top: -3px; }
.index-compass::after { bottom: -3px; }
.index-compass .icon { width: 28px; height: 28px; stroke-width: 1.1; }
.chapter-nav { display: grid; gap: 22px; }
.group-name {
  color: #9cb5c9;
  font: 600 10px/1.4 Myriad, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.chapter-group ul {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chapter-group ul::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 22px;
  bottom: 22px;
  width: 1px;
  background: linear-gradient(#425c70, #38546c);
}
.chapter-nav a {
  position: relative;
  isolation: isolate;
  gap: 12px;
  min-height: 45px;
  padding: 4px 0;
  border: 0;
  font-size: 16px;
  line-height: 1.2;
  color: #b7c7d7;
}
.chapter-nav a:hover, .chapter-nav a[aria-current=location] {
  color: #f3f8ff;
  background: none;
}
.waymark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid #344b61;
  border-radius: 50%;
  background: #0b1624;
  color: #88acc6;
}
.chapter-nav a .icon { width: 16px; height: 16px; opacity: 1; }
.chapter-nav a[aria-current=location] .waymark {
  border-color: #b1d9ef;
  color: #effaff;
  background: radial-gradient(circle at 53% 30%, #4279a0, #13283c 75%);
  box-shadow: 0 0 0 3px #112334, 0 0 22px #4a97cc46;
}
.chapter-nav a:hover .waymark { border-color: #8eb3cf; color: #f0faff; }
.chapter-nav a[aria-current=location] { font-weight: 600; }
.chapter-nav a[aria-current=location]::after {
  content: "";
  flex: 1;
  max-width: 32px;
  height: 1px;
  background: linear-gradient(90deg,#6588a1,transparent);
}
.drawer-chapters { gap: 16px; }
.drawer-chapters .chapter-group ul { gap: 1px; }
.drawer-chapters .waymark { width: 28px; height: 28px; }
.drawer-chapters .chapter-group ul::before { left: 14px; }

/* The three milestones are one permanent, chronological inscription. */
#storia { padding-top: clamp(72px, 7vw, 116px); padding-bottom: clamp(60px, 6vw, 96px); }
.chronicle-art, .relic-art, .map-art {
  position: absolute;
  z-index: -2;
  pointer-events: none;
  display: block;
  max-width: none;
  object-fit: cover;
  --edge-x: linear-gradient(90deg,transparent,#000 11%,#000 89%,transparent);
  --edge-y: linear-gradient(180deg,transparent,#000 14%,#000 84%,transparent);
  -webkit-mask-image: var(--fade), var(--edge-x), var(--edge-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade), var(--edge-x), var(--edge-y);
  mask-composite: intersect;
}
.chronicle-art {
  --fade: radial-gradient(ellipse 69% 59% at 52% 49%, #000 50%, #000c 69%, transparent 99%);
  inset: 0;
  width: 100%;
  height: 100%;
  object-position: 66% 50%;
}
#storia::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #080f1b55, transparent 27%, #080f1b33 46%, #080f1be0 95%);
}
#storia .chapter-heading { margin-bottom: clamp(90px, 11vw, 170px); }
.chronicle {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  max-width: 1060px;
  margin: auto;
  padding: 0 clamp(12px, 3vw, 48px);
  list-style: none;
}
.chronicle li { text-align: center; position: relative; padding: 22px clamp(9px, 1.6vw, 26px) 0; }
.chronicle li::before {
  content: "";
  position: absolute;
  height: 1px;
  top: 0;
  left: 0;
  right: 0;
  background: #85a6bd94;
}
.chronicle li:first-child::before { background: linear-gradient(90deg,transparent,#85a6bd94 55%); }
.chronicle li:last-child::before { background: linear-gradient(90deg,#85a6bd94 45%,transparent); }
.chronicle li::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 8px;
  border: 1px solid #bcdff7;
  transform: translate(-50%,-50%) rotate(45deg);
  background: #375977;
  box-shadow: 0 0 0 3px #132336, 0 0 15px #70bbf38a;
}
.chronicle time {
  display: block;
  font: 400 clamp(38px,3.8vw,62px)/1 var(--serif);
  letter-spacing: -.055em;
  color: #e3f1fd;
  text-shadow: 0 2px 18px #071525;
}
.chronicle h3 {
  margin: 10px 0 7px;
  color: #ddcbc0;
  font: italic clamp(19px,1.65vw,25px)/1.13 var(--serif);
  text-wrap: balance;
}
.chronicle p { color: #d4dfeb; font-size: 16px; line-height: 1.43; text-wrap: pretty; }

/* Items, illustrations and captions sit in the same scene. */
.relic-scene {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(340px, 32vw, 480px);
}
.relic-art {
  --fade: radial-gradient(ellipse 66% 57% at 61% 52%, #000 43%, #000e 58%, transparent 93%);
  inset: 0;
  width: 100%;
  height: 100%;
  object-position: 67% 58%;
}
.relic-display { position: relative; width: min(53%,545px); padding: 24px 0 24px clamp(12px,4.8vw,78px); }
.relic-display::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10px -14% -10px -4%;
  background: radial-gradient(ellipse closest-side at 42% 53%,#080f1be6 38%, transparent 100%);
  pointer-events: none;
}
.relic-display .item-select {
  max-width: 425px;
  grid-template-columns: repeat(4,auto);
  gap: 5px;
  align-items: start;
}
.relic-display .item-select button { overflow-wrap: normal; hyphens: auto; }
.item-select button { padding: 3px 1px 7px; color: #bbcbd8; }
.item-icon {
  position: relative;
  width: clamp(45px,4vw,59px);
  height: auto;
  aspect-ratio: 1;
  color: #a8cce5;
  border: 1px solid #546f8566;
  border-radius: 50%;
  background: radial-gradient(circle,#24374a99,transparent 72%);
}
.item-select button[aria-pressed=true] .item-icon, .item-select button:hover .item-icon {
  border-color: #a7c5d9;
  background: radial-gradient(circle,#35546bbb,transparent);
  box-shadow: 0 0 0 3px #67879e24,0 0 22px #85c7ec28;
}
.item-select button[aria-pressed=true] .item-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%) rotate(45deg);
  background: #c4e9ff;
}
.item-icon img { width: 76%; height: 76%; object-fit: contain; }
.potion-pair img { position: absolute; width: 57%; height: 66%; }
.potion-pair img:first-child { left: 8%; bottom: 10%; z-index: 1; transform: rotate(-7deg); }
.potion-pair img:last-child { right: 6%; top: 12%; transform: rotate(9deg); }
.relic-detail { margin: 25px 0 16px; min-height: 105px; }
.relic-detail h3, .map-caption h3 {
  color: #f0eee7;
  font: 400 clamp(31px,3vw,48px)/1.07 var(--serif);
  letter-spacing: -.043em;
  text-wrap: balance;
}
.relic-detail p, .map-caption p { color: #cedce8; margin-top: 11px; font-size: 18px; line-height: 1.48; text-wrap: pretty; }
.inventory-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  color: #c6e5f9;
  border-bottom: 1px solid #6b92ac;
  font-weight: 600;
}
.inventory-link .icon { width: 17px; height: 17px; }
.inventory-link:hover { color: #fff1d7; border-color: var(--moon-gold); }
.extras { margin: 0 auto; max-width: 680px; }

.level-picker, .route-steps { width: min(100%,780px); margin-inline: auto; }
.level-picker { background: none; padding-inline: 8px; }
.route-steps { gap: 8px; padding: 6px 0 8px; }
.route-steps button {
  position: relative;
  min-height: 42px;
  border: 0;
  font-family: var(--serif);
}
.route-steps button[aria-pressed=true], .route-steps button:hover { color: #d7efff; background: none; }
.route-steps button[aria-pressed=true]::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  background: #ace1ff;
  box-shadow: 0 0 8px #a6dcfe7a;
}
.atlas-landscape {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(310px,26vw,420px);
}
.map-art {
  --fade: radial-gradient(ellipse 58% 59% at 66% 52%,#000 42%,#000b 66%,transparent 95%);
  inset: 0 0 0 auto;
  width: 82%;
  height: 100%;
  object-position: 57% 48%;
}
.map-caption {
  position: relative;
  width: 54%;
  padding: 35px 0 35px clamp(12px,4.4vw,72px);
}
.map-caption::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10% -26% -10% -4%;
  background: radial-gradient(ellipse closest-side at 40% 50%,#080f1b 40%,#080f1bb3 80%,transparent 100%);
}
.map-level { display: inline-flex; align-items: center; gap: 9px; color: var(--moon-gold); margin-bottom: 12px; font: italic 20px/1.2 var(--serif); }
.map-level .icon { width: 18px; height: 18px; }
.lang-grid button { border: 0; border-radius: 20px; padding-left: 9px; }
.lang-grid button:hover, .lang-grid button[aria-pressed=true] { background: linear-gradient(90deg,#28465c94,transparent 96%); }

@media (min-width:871px) {
  .reading { grid-template-columns: clamp(150px,14vw,220px) minmax(0,1fr); gap: clamp(16px,2.6vw,44px); padding-right: 0; }
}
@media (max-width:870px) {
  :root { scroll-padding-top: calc(var(--head) + 54px); }
  .mobile-index {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    z-index: 5;
    top: calc(var(--head) - 1px);
    min-height: 42px;
    width: 100%;
    padding: 4px 8px;
    background: linear-gradient(90deg,#0a1623,#0b1928 80%,#0a1524);
    border-bottom: 1px solid #31475a;
    color: #d3e9f8;
    font-size: 14px;
  }
  .mobile-index span:first-child { display: inline-flex; align-items: center; gap: 7px; }
  .mobile-index b { margin-inline-start: auto; font-family: var(--serif); font-weight: 400; }
  .mobile-index .icon { width: 16px; height: 16px; }
  .mobile-index > .icon { width: 13px; }
  .chronicle { padding-inline: 0; }
  .relic-display { padding-left: 6px; }
}
@media (max-width:680px) {
  #storia { padding: 38px 0 26px; }
  #storia .chapter-heading { margin-bottom: 24px; }
  .chronicle-art {
    --fade: radial-gradient(ellipse 73% 62% at 63% 47%,#000 35%,#000c 56%,transparent 87%);
    object-position: 82% center;
    opacity: .65;
  }
  #storia::before { background: linear-gradient(90deg,#080f1b77,transparent 70%),linear-gradient(0deg,#080f1bf0,transparent 63%); }
  .chronicle { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 auto; max-width: 435px; padding: 0 9px; }
  .chronicle li { display: grid; grid-template-columns: 72px 1fr; gap: 3px 13px; padding: 10px 0 12px 19px; text-align: left; }
  .chronicle li::before, .chronicle li:first-child::before, .chronicle li:last-child::before { top: 0; bottom: 0; left: 2px; width: 1px; height: auto; background: #6b8fa78c; }
  .chronicle li:first-child::before { top: 27px; }
  .chronicle li:last-child::before { height: 27px; }
  .chronicle li::after { left: 2px; top: 27px; width: 5px; height: 5px; }
  .chronicle time { grid-row: span 2; font-size: 35px; align-self: start; }
  .chronicle h3 { margin: 0; font-size: 19px; }
  .chronicle p { font-size: 15px; line-height: 1.32; }
  .relic-scene { min-height: 0; padding-top: clamp(108px,37vw,202px); }
  .relic-art {
    --fade: radial-gradient(ellipse 77% 56% at 53% 47%,#000 49%,#000b 64%,transparent 96%);
    inset: 0;
    width: 100%;
    height: clamp(145px,45vw,225px);
    object-position: right center;
  }
  .relic-display { width: min(100%,470px); margin: auto; padding: 10px 4px 24px; text-align: center; }
  .relic-display::before { content: none; }
  .relic-display .item-select { margin: auto; }
  .relic-detail { margin: 14px 0 8px; min-height: 85px; }
  .relic-detail h3, .map-caption h3 { font-size: 31px; }
  .relic-detail p, .map-caption p { font-size: 17px; }
  .route-steps { gap: 2px; }
  .atlas-landscape { min-height: 0; padding-top: clamp(128px,42vw,204px); }
  .map-art {
    --fade: radial-gradient(ellipse 76% 56% at 52% 49%,#000 42%,#000c 65%,transparent 95%);
    inset: 0;
    width: 100%;
    height: clamp(169px,53vw,255px);
  }
  .map-caption { width: 100%; padding: 2px 9px 12px; text-align: center; }
  .map-caption::before { content: none; }
  .map-level { margin-bottom: 6px; font-size: 17px; }
  .group-name { margin-bottom: 5px; }
}
@media (prefers-reduced-motion:no-preference) {
  .waymark, .item-icon { transition: box-shadow .2s, border-color .2s, color .2s; }
  .relic-detail article, .map-caption { animation: entrance .28s ease-out both; }
}
