/* Site chrome shared by the guest pages: floating bar, side drawer, page container.
   Values come from docs/superpowers/specs/2026-10-21-ui-design.md ("Top menu bar", "Menu"). */
:root {
  --bar-fade: clamp(5px, calc(5px + (100vw - 360px) * 2 / 840), 7px);   /* feathered lower edge */
  --bar-ext: clamp(3px, calc(3px + (100vw - 360px) / 840), 4px);       /* tint reaches this far below the bar */
  --bar-pad: clamp(16px, calc(16px + (100vw - 360px) * 16 / 840), 32px);
  --drawer-w: min(78vw, 380px);
  --fleuron-h: calc(var(--drawer-w) * 0.04);                            /* band is about 25:1 */
  --ease-drawer: cubic-bezier(0.22, 0.8, 0.3, 1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.fleuron { display: block; width: 100%; height: auto; }

html { scroll-padding-top: calc(var(--bar-h) + var(--space-3)); } /* keeps scrolled-to content clear of the bar */

/* Bar */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar-h);
  padding: 0 var(--bar-pad);
  opacity: var(--bar-opacity, 1);
  color: var(--color-text);
}
.bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: calc(-1 * var(--bar-ext));
  z-index: -1;
  background: rgba(243, 238, 226, 0.8);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--bar-fade)), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - var(--bar-fade)), transparent 100%);
}
.bar-hidden { pointer-events: none; }

.menu-button {
  position: relative;
  width: var(--tap-size);
  height: var(--tap-size);
  margin-left: calc(-1 * var(--space-2));
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

/* Menu icon: three lines that turn into a close mark while the drawer is open. */
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 1.375rem;
  height: 2px;
  background: currentColor;
  content: "";
  transition: transform 0.25s ease, top 0.25s ease, background-color 0.25s ease;
}
.menu-icon { position: relative; margin: 0 auto; }
.menu-icon::before { position: absolute; top: -7px; }
.menu-icon::after { position: absolute; top: 7px; }
.menu-button[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-button[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }

/* Language toggle: small caps in a thin ink border, like the Accepts/Declines buttons. */
.lang-button {
  position: relative;
  padding: 2px 8px;
  border: 1.5px solid var(--color-text);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-variant: small-caps;
  font-size: clamp(16px, calc(16px + (100vw - 360px) * 2 / 840), 18px);
  letter-spacing: 0.1em;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}
.lang-button::after { content: ""; position: absolute; inset: -11px -6px; } /* at least 44px-tall tap area */

/* Dimming layer and drawer */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(17, 17, 17, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.drawer-open .scrim { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: calc(var(--bar-h) - 3px);   /* tucked under the bar's soft edge so there is no seam */
  bottom: 0;
  left: 0;
  z-index: 21;
  width: var(--drawer-w);
  padding: var(--space-3) clamp(22px, 2.5vw, 32px) 0;
  background: rgba(243, 238, 226, 0.8);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  border-right: 1.5px solid var(--color-text);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform 0.4s var(--ease-drawer), visibility 0s linear 0.4s;
}
.drawer-open .drawer { transform: none; visibility: visible; transition-delay: 0s; }

.drawer ul { margin: 0; padding: var(--space-3) 0 0; list-style: none; }
.drawer a {
  display: block;
  padding: clamp(14px, 1.5vw, 18px) 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  font-variant: small-caps;
  font-size: clamp(24px, calc(24px + (100vw - 360px) * 6 / 840), 30px);
  letter-spacing: 0.08em;
  text-decoration: none;
}
.drawer li:last-child a { border-bottom: 1px solid var(--color-border); }
.drawer a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

.drawer-lang {
  position: absolute;
  right: clamp(22px, 2.5vw, 32px);
  bottom: calc(var(--fleuron-h) + 19px);
}
.drawer-fleuron {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .drawer, .scrim, .menu-icon, .menu-icon::before, .menu-icon::after { transition: none; }
}

/* Page content: the bar floats over everything, so content starts below it unless the page
   opens with a scene at the very top (body.has-hero). */
.page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: calc(var(--bar-h) + var(--space-4)) var(--space-3) var(--space-4);
}
.has-hero .page { padding-top: var(--space-4); }
