/* Shared on every page: font, skip link, menu button and panel, header links, footer legal row.
   Page styles (tokens, layout) live in their own file and are loaded after this one. */
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff2") format("woff2-variations"), url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
/* Menu: a floating button, the panel slides in from the right */
.menu-btn {
  position: fixed; z-index: 45;
  top: calc(env(safe-area-inset-top, 0px) + 0.85rem);
  right: max(18px, env(safe-area-inset-right, 0px));
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18); cursor: pointer;
  background: rgba(12,14,44,0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 0;
  box-shadow: 0 6px 20px -8px rgba(0,0,0,0.5);
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 1.05rem; height: 2px; border-radius: 2px; background: #ffffff; position: relative;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }
.menu-btn:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; }

#menu {
  margin: 0; border: 0; inset: 0 0 0 auto;
  width: min(21rem, 86vw); height: 100%; max-height: none;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) max(22px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 1.5rem) 1.6rem;
  background:
    radial-gradient(20rem 16rem at 100% 0%, rgba(138,124,255,0.4), transparent 70%),
    radial-gradient(16rem 12rem at 0% 100%, rgba(240,84,79,0.22), transparent 70%),
    var(--night);
  color: var(--night-fg);
  display: none; flex-direction: column; gap: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), overlay 0.35s allow-discrete, display 0.35s allow-discrete;
}
#menu:popover-open { display: flex; transform: translateX(0); }
@starting-style { #menu:popover-open { transform: translateX(100%); } }
#menu::backdrop {
  background: rgba(8,9,30,0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0);
  transition: background 0.35s, backdrop-filter 0.35s, overlay 0.35s allow-discrete, display 0.35s allow-discrete;
}
#menu:popover-open::backdrop { background: rgba(8,9,30,0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@starting-style { #menu:popover-open::backdrop { background: rgba(8,9,30,0); backdrop-filter: blur(0); } }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-close {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); color: #ffffff;
  font-size: 1.4rem; line-height: 1;
}
.menu-close:focus-visible, #menu a:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; }
#menu ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; counter-reset: m; }
#menu li a {
  display: flex; align-items: baseline; gap: 0.8rem; padding-block: 0.45rem;
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; font-stretch: 88%;
  color: var(--night-fg); text-decoration: none;
}
#menu li a:hover { color: #ff9a90; }
#menu li a[aria-current="page"] { color: #ff8a7d; }

/* Site nav: text links in the header on wide screens, the menu panel on phones */
.toplinks { display: none; }
#menu .menu-contact { margin-top: auto; display: grid; gap: 0.75rem; }
#menu .menu-contact ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
#menu .menu-contact a {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 2.6rem; padding: 0 0.95rem;
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08);
  color: var(--night-fg); text-decoration: none; font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; font-stretch: 100%;
}
#menu .menu-contact a:hover { background: rgba(255,255,255,0.16); border-color: #ff7a6e; }
.menu-contact svg { width: 1.05rem; height: 1.05rem; flex: none; }
.menu-contact p { margin: 0; font-size: 0.875rem; color: var(--night-muted); }
@media (min-width: 780px) {
  .toplinks { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; }
  .toplinks a {
    color: var(--night-fg); text-decoration: none; font-weight: 600; font-size: 0.95rem;
    padding-block: 0.3rem; border-bottom: 2px solid transparent;
  }
  .toplinks a:hover, .toplinks a[aria-current="page"] { border-bottom-color: #ff7a6e; }
  .toplinks a:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; border-radius: 4px; }
  /* The header links scroll away; the menu button fades in once they are out of view */
  .menu-btn { right: var(--menu-right, 18px); opacity: 0; visibility: hidden; transform: scale(0.85); transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s; }
  .past-header .menu-btn { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s, transform 0.25s; }
}
/* Skip link: first stop for keyboard and screen reader users, visible only on focus */
.skip { position: absolute; left: 1rem; top: -10rem; z-index: 100; padding: 0.7rem 1.1rem; border-radius: 10px; background: #ffffff; color: #0c0e2c; font-weight: 700; text-decoration: none; box-shadow: 0 6px 24px -8px rgba(0,0,0,0.5); }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); outline: 3px solid #ff7a6e; outline-offset: 2px; }
/* Text for screen readers only */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Footer easter egg: its own quiet line at the very end */
.egg { flex-basis: 100%; font-style: italic; }
/* Legal row in every footer: plain text and padded links share one baseline */
.legal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem; }
.legal a { display: inline-block; padding-block: 0.25rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
