#landmark-book {
  --page-color: #fdf8ed;
  --close-ink: #594e39;
  --book-control-size: 44px;
  --book-control-gap: .5rem;
  --book-control-bottom: clamp(1.25rem, 4.1vh, 2.5rem);
  --book-top-space: clamp(1rem, 3.2vh, 2rem);
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: clip;
  border: 0;
  background: transparent;
  color: var(--ink);
}
:root:is([data-theme="dusk"], [data-theme="night"]) #landmark-book {
  --page-color: var(--paper);
  --close-ink: var(--ink);
}
#landmark-book::backdrop {
  background: transparent;
}
.atlas {
  --corner: clamp(1.8rem, 3.8vw, 4.65rem);
  --book-blur: blur(26px) saturate(1.24);
  --glass-edge: inset 0 1px 1px #fff8, inset 0 -1px 0 #fff4, 0 7px 22px #122c251a;
}
.book-stage,
.leaf-frost-stage,
.book-frost {
  position: absolute;
  inset: max(4.45%, env(safe-area-inset-top)) max(4%, env(safe-area-inset-right))
    max(3.9%, env(safe-area-inset-bottom)) var(--book-rail);
}
.book-frost, .rail-frost {
  pointer-events: none;
  border-radius: var(--corner);
  corner-shape: superellipse(1.25);
  opacity: 0;
  visibility: hidden;
}
.atlas:has(#landmark-book[open]) :is(.book-frost, .rail-frost) {
  opacity: 1;
  visibility: visible;
}
.book-page {
  --book-edge: clamp(1.1rem, 4.8cqw, 4.8rem);
  container-type: size;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--corner);
  corner-shape: superellipse(1.25);
  background: var(--page-color);
  box-shadow: var(--glass-edge);
  perspective: 2050px;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  /* Sample the live map at its own stacking level, outside the native modal's top layer. */
  .leaf-frost,
  .rail-frost,
  .book-frost {
    -webkit-backdrop-filter: var(--book-blur);
    backdrop-filter: var(--book-blur);
  }
  .book-page {
    background: linear-gradient(
      112deg,
      color-mix(in srgb, var(--page-color) 83%, transparent),
      color-mix(in srgb, var(--page-color) 68%, transparent) 52%,
      color-mix(in srgb, var(--page-color) 52%, transparent)
    );
  }
  :root:is([data-theme="dusk"], [data-theme="night"]) .book-page {
    background: linear-gradient(
      112deg,
      color-mix(in srgb, var(--page-color) 88%, transparent),
      color-mix(in srgb, var(--page-color) 77%, transparent) 56%,
      color-mix(in srgb, var(--page-color) 62%, transparent)
    );
  }
}
/* The modal sits above the map. Sample the map at scene level through
   a second half-width pane, registered to the same hinge as its printed face. */
.leaf-frost-stage { display: none; pointer-events: none; }
.atlas:has(#landmark-book:is([data-state="opening"], [data-state="closing"])) .leaf-frost-stage {
  display: block;
}
.leaf-frost {
  position: absolute;
  inset: 0 50% 0 0;
  transform-origin: right center;
  border-radius: var(--corner) 0 0 var(--corner);
  corner-shape: superellipse(1.25);
  backface-visibility: hidden;
}
.book-binding,
.book-hinge,
.book-jacket,
.book-inside {
  position: absolute;
  inset: 0;
}
.book-hinge {
  right: 50%;
  z-index: 3;
  transform-origin: right center;
  pointer-events: none;
}
#landmark-book:is([data-state="open"], [data-state="flipping"]) .book-hinge {
  display: none;
}
.book-jacket,
.book-inside {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-jacket {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4em;
  left: 100%;
  right: auto;
  width: 100%;
  transform-origin: left center;
  border-radius: 2px var(--corner) var(--corner) 2px;
  background: var(--grain) 0 0 / 148px, linear-gradient(90deg,#163b32,#315448 5%,#284c40 8%,#1e4136);
  box-shadow: inset 3px 0 2px #152e29, inset -2px -2px 0 #bfa776, 0 3px 8px #182e2440;
  color: #e7d19e;
  font: 600 clamp(1.2rem, 3vw, 3rem) / 1 var(--display);
}
.book-jacket::before {
  content: "";
  position: absolute;
  inset: 3% 5% 3% 8%;
  border: 1px solid #c5ac74a3;
  border-radius: 1px calc(var(--corner) * .76) calc(var(--corner) * .76) 1px;
}
.book-jacket .icon { width: 1.45em; height: 1.45em; }
.book-inside {
  transform-origin: right center;
  overflow: hidden;
  border-radius: var(--corner) 0 0 var(--corner);
  corner-shape: superellipse(1.25);
}
.book-inside .book-page {
  width: 200%;
}
.book-inside::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 88%, #533d1c03 97%, #392a190c);
}
.book-face {
  position: absolute;
  inset: 0;
}
#landmark-book[data-state="flipping"] .book-binding > .book-page {
  perspective: max(2050px, 130vw);
}
.book-page-marks {
  --dash-width: clamp(8px, 2.15cqw, 24px);
  --dash-pitch: calc(var(--dash-width) + clamp(3px, .85cqw, 10px));
  position: absolute;
  left: calc(var(--book-edge) - (var(--dash-pitch) - var(--dash-width)) / 2);
  bottom: var(--book-control-bottom);
  z-index: 2;
  display: flex;
  align-items: center;
  height: var(--book-control-size);
  color: var(--folio-ink);
  pointer-events: none;
}
.book-page-marks > * {
  display: grid;
  place-items: center;
  width: var(--dash-pitch);
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.book-page-marks button {
  pointer-events: auto;
  touch-action: manipulation;
}
.book-page-marks button:focus-visible {
  outline-offset: -2px;
  border-radius: 4px;
}
.book-page-marks > *::before {
  content: "";
  width: var(--dash-width);
  border-top: 1px solid currentColor;
  opacity: .38;
}
.book-page-marks [aria-current="page"]::before {
  border-top-width: 3px;
  opacity: 1;
}
@media (pointer: coarse), (max-width: 48rem) {
  .book-page-marks { --dash-pitch: clamp(26px, 6.8cqw, 44px); }
}
@container (max-width: 24rem) {
  /* Leave the last page's longer CTA a separate row of touch targets. */
  .book-page-marks:has(+ .book-pager[data-final]:not([hidden])) {
    bottom: calc(var(--book-control-bottom) + var(--book-control-size));
  }
  .book-face[data-book-page="guild"] .work-reader,
  .book-page .book-face[data-book-page="castle"] .book-reader {
    bottom: calc(var(--book-control-bottom) + 2 * var(--book-control-size) + .5rem);
  }
}
.book-pager {
  position: absolute;
  right: var(--book-edge);
  bottom: var(--book-control-bottom);
  z-index: 2;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-items: start;
  gap: var(--book-control-gap);
  pointer-events: none;
}
.book-pager button { pointer-events: auto; }
.book-pager [data-page-step] {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--folio-ink);
  touch-action: manipulation;
}
.book-pager [data-page-step="-1"] { grid-area: 1 / 1; }
.book-pager [data-page-step="1"], .book-pager .book-cta { grid-area: 1 / 2; }
.book-pager [data-page-step]:disabled { opacity: .34; cursor: default; }
.book-pager [data-page-step]:enabled:active { transform: translateY(1px); }
.book-pager .icon { width: 22px; height: 22px; stroke-width: 1.65; }

.book-cta {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: var(--book-control-size);
  padding: 0 .1em 0 .4em;
  border: 0;
  background: transparent;
  color: var(--folio-ink);
  font: 650 clamp(1.14rem, 1.65cqw, 1.35rem)/1.1 var(--display);
  touch-action: manipulation;
}
.book-cta span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
  text-underline-offset: .2em;
}
.book-cta::after {
  content: "";
  width: 1.45em;
  aspect-ratio: 42 / 25;
  background: currentColor;
  mask: url("assets/proof-skill.svg") center / contain no-repeat;
}
.book-cta:is(:hover, :focus-visible) span {
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}
@media (hover: hover) {
  .book-pager [data-page-step]:enabled:hover { background: color-mix(in srgb, currentColor 7%, transparent); }
}
@media (prefers-reduced-motion: no-preference) {
  .book-pager[data-final] .book-cta:not([hidden]) { animation: book-invitation-in .32s var(--ease) both; }
  @keyframes book-invitation-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.book-leaf-face {
  position: absolute;
  inset: 0 50% 0 0;
  overflow: hidden;
  z-index: 1;
  transform-origin: right center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--corner) 0 0 var(--corner);
  corner-shape: superellipse(1.25);
  pointer-events: none;
}
.book-leaf-face[data-half="right"] {
  inset: 0 0 0 50%;
  transform-origin: left center;
  border-radius: 0 var(--corner) var(--corner) 0;
}
.book-leaf-face > .book-face {
  width: 200%;
}
.book-leaf-face[data-half="right"] > .book-face {
  left: -100%;
}
.book-rail, .rail-frost {
  position: absolute;
  inset: max(4.45%, env(safe-area-inset-top)) auto max(3.9%, env(safe-area-inset-bottom)) 0;
  width: calc(var(--book-rail) - clamp(0.85rem, 2.45vw, 2.4rem));
  border-radius: 0 var(--corner) var(--corner) 0;
  corner-shape: superellipse(1.25);
}
.book-rail {
  --rail-ink: #f5efdd;
  --rail-surface: #10291e;
  z-index: 4;
  padding: 0 max(0.62rem, 0.9vw) var(--book-control-bottom) max(0.62rem, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  color: var(--rail-ink);
  background: var(--rail-surface);
  box-shadow: var(--glass-edge);
  isolation: isolate;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .book-rail {
    --rail-surface: linear-gradient(112deg, rgb(16 45 32 / .93), rgb(8 34 23 / .87) 52%, rgb(5 26 17 / .81));
  }
}
.rail-brand {
  grid-row: 1;
  align-self: start;
  width: min(83%, 9rem);
  /* An 8px right margin offsets the centered short wordmark 4px to the left. */
  margin: clamp(1.1rem, 3vh, 2rem) 8px 0 0;
  padding: 0;
  background: transparent;
}
.rail-brand picture, .rail-brand img { display: block; width: 100%; height: auto; }
.book-menu-toggle { display: none; }
.book-menu-panel { display: contents; }
.book-shortcuts {
  grid-row: 2;
  width: min(100%, 12rem);
  display: grid;
  gap: clamp(.15rem, .7vh, .5rem);
  position: relative;
  padding-block: .75rem;
}
.book-shortcuts button {
  --slip-ink: var(--rail-ink);
  display: flex;
  align-items: center;
  gap: .4em;
  position: relative;
  isolation: isolate;
  min-height: 44px;
  padding: .42rem clamp(.45rem, .8vw, 1.05rem);
  color: var(--rail-ink);
  background: none;
  font: 650 clamp(1.06rem, 1.55vw, 1.42rem) / 1 var(--display);
  white-space: nowrap;
}
.book-shortcuts .slip-art {
  z-index: -1;
  opacity: 0;
}
.book-shortcuts .icon { width: 1.12em; height: 1.12em; color: var(--slip-ink); }
.book-shortcuts button[aria-current="page"] {
  --slip-paper: #e8d4a8;
  --slip-highlight: #fff1c9;
  --slip-shadow: #a28153;
  --slip-ink: #5c432a;
  --slip-rule: #a38351;
  color: #342d22;
}
.book-shortcuts [aria-current] .slip-art { opacity: 1; }
.book-shortcuts button:not([aria-current]):is(:hover, :focus-visible) {
  text-decoration: underline;
  text-underline-offset: .2em;
}
.book-rail .map-tools {
  grid-row: 3;
  align-self: end;
  position: relative;
  inset: auto;
  justify-content: center;
  gap: var(--book-control-gap);
  animation: none;
}
.book-rail .map-tools > button, .book-pager [data-page-step] {
  width: var(--book-control-size);
  height: var(--book-control-size);
}
.book-rail .map-tools > button {
  --rail-tool-outline: color-mix(in srgb, currentColor 50%, transparent);
  color: var(--rail-ink);
  background: transparent;
  border: 1px solid var(--rail-tool-outline);
  box-shadow: none;
}
.book-rail :is(button, a):focus-visible { outline: 2px solid var(--rail-ink); outline-offset: 2px; }
.book-rail #accessibility-note {
  inset-inline: max(-.6rem, calc(-.5 * (var(--book-rail) - 7rem))) auto;
  color: #352e24;
  background: #f6ebcd;
  border: 1px solid #bca077;
}
.book-page::before, .book-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grain) 0 0 / 148px 148px;
  opacity: 0.36;
  pointer-events: none;
}
.book-rail::before { border-radius: inherit; corner-shape: inherit; z-index: -1; }
.book-reader {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding: clamp(5rem, 11vh, 7.5rem) clamp(1.6rem, 5vw, 6rem) clamp(2rem, 7vh, 5rem);
}
.book-reader:focus-visible {
  outline-offset: -6px;
  border-radius: inherit;
}
.book-reader article {
  width: min(100%, 70ch);
  margin-inline: auto;
  overflow-wrap: anywhere;
}
#close-book {
  position: absolute;
  z-index: 2;
  top: calc(var(--corner) * .2);
  right: calc(var(--corner) * .2);
  display: grid;
  place-items: center;
  width: var(--book-control-size);
  height: var(--book-control-size);
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--close-ink);
}
#close-book .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.65;
}
@media (hover: hover) {
  #close-book:hover {
    background: color-mix(in srgb, currentColor 7%, transparent);
  }
}
.book-page,
.book-frost {
  transform-origin: left center;
}
@media (max-width: 48rem), (max-width: 60rem) and (max-height: 32rem) {
  #landmark-book { --book-control-bottom: 1rem; }
  .atlas {
    --corner: clamp(1.35rem, 5vw, 2.1rem);
    --book-gutter: clamp(.45rem, 2.4vw, 1rem);
    --header-top: max(.4rem, env(safe-area-inset-top));
    --header-height: clamp(3rem, 7vh, 3.5rem);
  }
  .book-stage, .leaf-frost-stage, .book-frost {
    inset: calc(var(--header-top) + var(--header-height) + .5rem)
      max(var(--book-gutter), env(safe-area-inset-right)) max(.65rem, env(safe-area-inset-bottom))
      max(var(--book-gutter), env(safe-area-inset-left));
  }
  .book-rail, .rail-frost {
    inset: var(--header-top) max(var(--book-gutter), env(safe-area-inset-right)) auto
      max(var(--book-gutter), env(safe-area-inset-left));
    width: auto;
    height: var(--header-height);
    border-radius: var(--corner);
  }
  .book-rail {
    padding: 0 .4rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .rail-brand {
    align-self: center;
    width: min(10.25rem, 55%);
    min-height: 44px;
    margin: 0 0 0 .9rem;
  }
  .book-menu-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: .35rem;
    color: var(--rail-ink);
    background: transparent;
  }
  .book-menu-toggle .icon { width: 1.55rem; height: 1.55rem; stroke-width: 1.85; }
  .menu-cross, .book-menu-toggle[aria-expanded="true"] .menu-bars { display: none; }
  .book-menu-toggle[aria-expanded="true"] .menu-cross { display: inline; }
  .book-menu-panel { display: none; }
  .book-menu-toggle[aria-expanded="true"] + .book-menu-panel {
    display: grid;
    position: absolute;
    top: calc(100% + .3rem);
    right: 0;
    width: min(15rem, 100%);
    max-height: calc(100dvh - var(--header-top) - var(--header-height) - env(safe-area-inset-bottom) - 1rem);
    overflow: auto;
    overscroll-behavior: contain;
    gap: .6rem;
    padding: .55rem .65rem .75rem;
    border-radius: .45rem .45rem .75rem .75rem;
    background: var(--rail-surface);
    -webkit-backdrop-filter: var(--book-blur);
    backdrop-filter: var(--book-blur);
    box-shadow: var(--glass-edge);
  }
  .book-shortcuts { grid-row: auto; width: 100%; padding: 0 0 .4rem; gap: .15rem; }
  .book-shortcuts button { padding-inline: 1rem; gap: .65rem; font-size: 1.23rem; }
  .book-rail .map-tools { grid-row: auto; flex-wrap: wrap; justify-content: start; padding-inline: .4rem; }
  .book-rail #accessibility-note {
    position: static;
    flex-basis: 100%;
    width: 100%;
  }
}
