/* NeuroDivine's public frame: the header, the footer and the candlelit
   ground every public page shares. The landing links it; the pages Python
   draws (the places, a place, a member's page) inline it, so it is one file
   either way. Every colour pair below is measured (WCAG 2.x, on --nd-night):
   ivory 15.8:1, smoke 8.7:1, rose 12.3:1, gold 8.5:1; ivory on wine 7.2:1.
   The brand's own colours (the red sun, plum rays, mat prints) are kept on
   the things that carry them: the mark, the halo and the prints. */

:root {
  --nd-night: #100C0B;
  --nd-night-2: #19120F;
  --nd-night-3: #241A16;
  --nd-ivory: #F1E6D8;
  --nd-smoke: #BCAB9A;
  --nd-rose: #F2C3BE;
  --nd-gold: #CDA56A;
  --nd-wine: #8E1F2C;
  --nd-oxblood: #5A1219;
  --nd-print: #FFFDFB;
  --nd-hair: rgb(241 230 216 / .14);
  --nd-hair-strong: rgb(241 230 216 / .3);
  --nd-script: "Great Vibes", "Pinyon Script", "Snell Roundhand", cursive;
  --nd-serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --nd-sans: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --nd-mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;
  --nd-gutter: clamp(1rem, 3.2vw, 2.5rem);
  --nd-wide: 84rem;
  --nd-ease: cubic-bezier(.2, .7, .2, 1);
}

/* The ground: night, lit from above as if by a candle on the table. */
.site {
  color-scheme: dark;
  background:
    radial-gradient(70rem 46rem at 50% -14rem, rgb(205 165 106 / .16), transparent 70%),
    var(--nd-night);
  background-color: var(--nd-night);
  color: var(--nd-ivory);
  font-family: var(--nd-sans);
  -webkit-font-smoothing: antialiased;
}
.site ::selection { background: rgb(242 195 190 / .32); color: var(--nd-ivory); }
.site a { color: inherit; }
.site :focus-visible { outline: 3px solid var(--nd-rose); outline-offset: 3px; border-radius: .25rem; }
.site .nm { text-transform: none; letter-spacing: .02em; }

/* ------------------------------------------------------------ header -- */
.site-head {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--nd-hair);
  background: linear-gradient(to bottom, rgb(16 12 11 / .96), rgb(16 12 11 / .86));
}
.site-nav {
  box-sizing: border-box;
  width: min(100% - 2 * var(--nd-gutter), var(--nd-wide));
  margin-inline: auto;
  min-height: 4.75rem;
  display: grid;
  /* the side columns never give up their 44px; the mark's column is the one that yields */
  grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr);
  /* the second row holds the phone menu when it is open, so it pushes the page down rather
     than lying over it: nothing a reader tabs to is ever hidden under it */
  grid-template-rows: 4.75rem auto;
  align-items: center;
  column-gap: 1rem;
  font-family: var(--nd-sans);
}
/* The smallest phones, and any phone before the web fonts arrive (a fallback script can run
   wider): the menu keeps its icon and its spoken name, the wordmark steps down, and nothing
   pushes the search button off the edge. */
@media (max-width: 23.4rem) {
  .site-nav { column-gap: .5rem; }
  .site-menu > summary > span:last-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .site-mark__script { font-size: 1.95rem; }
}
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-links { display: none; }
.site-links a, .site-menu__list a {
  color: var(--nd-ivory);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .01em;
}
.site-links a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding-inline: .1rem;
  background: linear-gradient(var(--nd-rose), var(--nd-rose)) left calc(100% - .7rem) / 0 1px no-repeat;
}
.site-links a[aria-current] { background-size: 100% 1px; }
.site-links svg { width: 1.15rem; height: 1.15rem; flex: none; }

.site-mark {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: .05rem;
  padding: .4rem .25rem .5rem;
  color: var(--nd-rose);
  text-decoration: none;
  line-height: 1;
}
.site-mark__script {
  font-family: var(--nd-script);
  font-weight: 400;
  font-size: clamp(2.15rem, 1.7rem + 1.6vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 0 1.4rem rgb(242 195 190 / .18);
}
.site-mark__from {
  font-family: var(--nd-mono);
  font-size: .625rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--nd-smoke);
  white-space: nowrap;
}

/* Phones: the mark in the middle, the menu to its left, search to its right. */
.site-menu { grid-column: 1 / -1; grid-row: 1 / span 2; align-self: start; }
.site-menu > summary {
  list-style: none;
  display: flex;
  width: fit-content;
  margin-block: calc((4.75rem - 44px) / 2);
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  min-width: 44px;
  padding-inline: .1rem;
  cursor: pointer;
  color: var(--nd-ivory);
  font-size: 1rem;
}
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu__icon, .site-menu__icon::before, .site-menu__icon::after {
  display: block;
  width: 1.25rem;
  height: 1px;
  background: currentColor;
}
.site-menu__icon { position: relative; }
.site-menu__icon::before, .site-menu__icon::after { content: ""; position: absolute; left: 0; }
.site-menu__icon::before { top: -.38rem; }
.site-menu__icon::after { top: .38rem; }
.site-menu[open] .site-menu__icon { background: transparent; }
.site-menu[open] .site-menu__icon::before { top: 0; transform: rotate(45deg); }
.site-menu[open] .site-menu__icon::after { top: 0; transform: rotate(-45deg); }
.site-menu__list {
  display: grid;
  margin: 0 calc(-1 * var(--nd-gutter)) !important;
  padding: .25rem var(--nd-gutter) 1.25rem !important;
  border-top: 1px solid var(--nd-hair);
}
.site-menu__list li + li { border-top: 1px solid var(--nd-hair); }
.site-menu__list a {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
  font-family: var(--nd-serif);
  font-size: 1.6rem;
  line-height: 1.1;
}
.site-menu__list a[aria-current] { color: var(--nd-rose); }
.site-search-tap {
  grid-column: 3;
  grid-row: 1;
  position: relative;
  z-index: 1;
  justify-self: end;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--nd-ivory);
}
.site-search-tap svg { width: 1.3rem; height: 1.3rem; }
.site-search-tap span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (min-width: 64rem) {
  .site-menu, .site-search-tap { display: none; }
  .site-links { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.25rem); }
  .site-links--left { grid-column: 1; grid-row: 1; justify-self: start; }
  .site-links--right { grid-column: 3; grid-row: 1; justify-self: end; }
  .site-nav { min-height: 6.25rem; grid-template-rows: 6.25rem; }
}

/* the first stop for a keyboard: straight past the header to the page */
.site .site-skip {
  position: absolute; z-index: 10; left: var(--nd-gutter); top: -12rem;
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1.2rem;
  border-radius: 999px; background: var(--nd-rose); color: var(--nd-night); font-weight: 600; text-decoration: none;
}
.site .site-skip:focus { top: .75rem; }

/* --------------------------------------------------------- shared parts -- */
.site-kicker {
  margin: 0;
  font-family: var(--nd-mono);
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--nd-gold);
}
.site-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1.1rem .4rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--nd-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--nd-ivory);
  background: rgb(16 12 11 / .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.site-badge::before { content: "\2731" / ""; color: var(--nd-gold); letter-spacing: 0; font-size: .95em; }

.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .7rem 1.45rem;
  border-radius: 999px;
  border: 1px solid var(--nd-hair-strong);
  font-family: var(--nd-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  color: var(--nd-ivory);
  background: transparent;
  cursor: pointer;
}
.site-btn--fill { background: var(--nd-wine); border-color: var(--nd-wine); color: var(--nd-ivory); }
.site-btn--rose { background: var(--nd-rose); border-color: var(--nd-rose); color: var(--nd-night); }


/* ------------------------------------------------------------ footer -- */
.site-foot {
  border-top: 1px solid var(--nd-hair);
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 2.5rem;
  color: var(--nd-smoke);
  font-size: .95rem;
}
.site-foot__in { width: min(100% - 2 * var(--nd-gutter), var(--nd-wide)); margin-inline: auto; }
.site-foot__mark {
  display: block;
  font-family: var(--nd-script);
  font-size: clamp(3rem, 2rem + 5vw, 5.5rem);
  line-height: 1.1;
  color: var(--nd-rose);
  margin: 0 0 1.25rem;
}
.site-foot a { color: var(--nd-ivory); text-underline-offset: .2em; text-decoration-color: var(--nd-hair-strong); }

/* ------------------------------------------------------------ motion -- */
@media (prefers-reduced-motion: no-preference) {
  .site-links a { transition: background-size .45s var(--nd-ease); }
  .site-btn { transition: transform .12s var(--nd-ease), background-color .3s var(--nd-ease), border-color .3s var(--nd-ease); }
  .site-btn:active { transform: scale(.975); }
  .site-menu[open] .site-menu__list { animation: site-drop .32s var(--nd-ease) backwards; }
  .site-menu__icon::before, .site-menu__icon::after { transition: transform .3s var(--nd-ease), top .3s var(--nd-ease); }
  @keyframes site-drop { from { opacity: 0; transform: translateY(-.5rem); } }
}
@media (hover: hover) {
  .site-links a:hover { background-size: 100% 1px; }
  .site-btn:hover { border-color: var(--nd-rose); }
  .site-btn--fill:hover { background: #A3283A; border-color: #A3283A; }
}
@media (forced-colors: active) {
  .site-badge, .site-btn { border: 1px solid CanvasText; }
}
