/* A quiet editorial menu, floating over the existing cloudscape. */
#section-menu-toggle {
  position: fixed;
  z-index: 120;
  top: calc(50% - 183px);
  right: 25px;
  display: inline-flex;
  min-width: 66px;
  min-height: 42px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 8px 0 8px 10px;
  border: 0;
  background: transparent;
  color: #f0e8d9;
  cursor: pointer;
  font: 500 0.62rem/1 'Inter', sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-shadow: 0 1px 9px rgba(13, 11, 8, .88), 0 0 14px rgba(240, 232, 217, .16);
  transition: color .24s ease, text-shadow .24s ease, opacity .24s ease;
  -webkit-tap-highlight-color: transparent;
}

#section-menu-toggle:hover,
#section-menu-toggle:focus-visible {
  color: #fff8e9;
  text-shadow: 0 0 12px rgba(244, 224, 185, .66), 0 0 28px rgba(244, 224, 185, .28);
}

#section-menu-toggle:focus-visible,
#section-menu-close:focus-visible,
#section-menu a:focus-visible {
  outline: 1px solid rgba(230, 204, 157, .9);
  outline-offset: 5px;
}

.section-menu-toggle-mark {
  display: block;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(240, 232, 217, .78);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(240, 232, 217, .2);
}

body.ascent-bright #section-menu-toggle {
  color: #342b1f;
  text-shadow: 0 1px 3px rgba(255, 249, 235, .55);
}

body.ascent-bright #section-menu-toggle:hover,
body.ascent-bright #section-menu-toggle:focus-visible {
  color: #211a13;
  text-shadow: 0 0 10px rgba(185, 139, 74, .65), 0 0 26px rgba(185, 139, 74, .32);
}

body.ascent-bright .section-menu-toggle-mark {
  border-color: rgba(58, 50, 39, .7);
  box-shadow: 0 0 10px rgba(185, 139, 74, .2);
}

html.site-intro-active #section-menu-toggle {
  visibility: hidden;
  pointer-events: none;
}

#section-menu[hidden] {
  display: none !important;
}

#section-menu {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(18px, 3vw, 34px) clamp(22px, 5vw, 64px) clamp(24px, 4vw, 42px);
  color: #eee7db;
  background: rgba(19, 18, 16, .78);
  -webkit-backdrop-filter: blur(16px) saturate(.72);
  backdrop-filter: blur(16px) saturate(.72);
  opacity: 0;
  transition: opacity .28s ease;
}

#section-menu.is-open {
  opacity: 1;
}

.section-menu-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-menu-topline img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid rgba(231, 219, 197, .32);
  border-radius: 8px;
  opacity: .78;
}

#section-menu-close {
  min-width: 66px;
  min-height: 42px;
  padding: 10px 0 10px 10px;
  border: 0;
  background: transparent;
  color: rgba(238, 231, 219, .78);
  cursor: pointer;
  font: 500 .61rem/1 'Inter', sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: color .2s ease, text-shadow .2s ease;
}

#section-menu-close:hover {
  color: #fff8e9;
  text-shadow: 0 0 14px rgba(244, 224, 185, .38);
}

.section-menu-chapters {
  align-self: center;
  justify-self: start;
  display: grid;
  gap: clamp(3px, .55vh, 8px);
  width: min(100%, 760px);
  padding: clamp(10px, 2vh, 24px) 0;
}

.section-menu-chapters a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: baseline;
  width: fit-content;
  max-width: 100%;
  color: #eee7db;
  font: italic 500 clamp(2.5rem, 6.3vw, 5.15rem)/.99 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.025em;
  text-decoration: none;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .25);
  transition: color .2s ease, text-shadow .2s ease, transform .2s ease;
}

.section-menu-chapters a:hover,
.section-menu-chapters a:focus-visible {
  color: #fff9ec;
  text-shadow: 0 0 15px rgba(240, 220, 185, .28), 0 0 36px rgba(240, 220, 185, .14);
  transform: translateX(5px);
}

.section-menu-index {
  color: rgba(220, 208, 189, .55);
  font: italic 500 .63rem/1 "EB Garamond", Georgia, serif;
  letter-spacing: .08em;
  transform: translateY(-.9em);
}

.section-menu-socials {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
}

.section-menu-socials a {
  padding: 9px 0;
  color: rgba(231, 221, 204, .7);
  font: 500 .59rem/1 'Inter', sans-serif;
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s ease, text-shadow .2s ease;
}

.section-menu-socials a:hover,
.section-menu-socials a:focus-visible {
  color: #fff8e9;
  text-shadow: 0 0 12px rgba(244, 224, 185, .52);
}

@media (max-width: 900px) {
  :root { --section-menu-rail-offset: 190px; }

  #section-menu-toggle {
    top: max(calc(50% - var(--section-menu-rail-offset)), var(--site-nav-clearance, 80px));
    right: 5px;
    min-width: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 4px 0;
    font-size: .52rem;
    letter-spacing: .1em;
  }

  .section-menu-toggle-mark { width: 7px; height: 7px; }

  /* Keep both controls together below a wrapped fixed header on short phones. */
  #section-rail {
    top: max(50%, calc(var(--site-nav-clearance, 80px) + var(--section-menu-rail-offset)));
  }
}

@media (max-width: 900px) and (max-height: 480px) {
  :root { --section-menu-rail-offset: 131px; }
  #section-rail { gap: 0; }
  #section-rail a { min-height: 28px; }
}

@media (max-height: 560px) {
  .section-menu-chapters { gap: 0; }
  .section-menu-chapters a { font-size: clamp(1.75rem, 7vh, 3.1rem); line-height: .94; }
  #section-menu { padding-block: 10px; }
  .section-menu-topline img { width: 28px; height: 28px; }
  .section-menu-socials a { padding-block: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  #section-menu,
  #section-menu-toggle,
  #section-menu-close,
  #section-menu a {
    transition: none !important;
  }

  .section-menu-chapters a:hover,
  .section-menu-chapters a:focus-visible { transform: none; }
}