/* MELUVIRA official header/footer + CatLab bar for CatLab EXHIBIT pages (shared by all exhibits).
   The official rules with tokens renamed --site-* (exhibits use --color-* for their own science colours);
   values unchanged. Source: CHAOS-0001 handoff 2026-11-26 site/site-chrome.css (sha256 9762af646fed…).
   Site/home/menu pages use the official styles.css + catlab.css instead. */

:root, :root[data-theme="dark"] {
  --site-bg: #121a1b; --site-surface: #182324; --site-surface-muted: #1e2b2c;
  --site-text: #eaf0ef; --site-text-muted: #a3b3b2; --site-border: #2b3a3b;
  --site-accent: #6cc0c3; --site-accent-contrast: #0f1718; --site-focus: #b7b8de; --site-accent-tint: #2e2f47;
}
:root[data-theme="light"] {
  --site-bg: #fafaf9; --site-surface: #ffffff; --site-surface-muted: #eef2f2;
  --site-text: #1d2b2c; --site-text-muted: #4f5f60; --site-border: #e1e2e2;
  --site-accent: #1b6b6f; --site-accent-contrast: #ffffff; --site-focus: #6f70a3; --site-accent-tint: #9293bd;
}
:root {
  --site-font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  --site-space-1: 0.5rem; --site-space-2: 1rem; --site-space-3: 1.5rem; --site-space-4: 2.5rem; --site-space-5: 4rem; --site-space-6: 6rem;
  --site-max-width: 72rem;
}

/* Visible, consistent focus state everywhere — never removed, only restyled. */
:focus-visible {
  outline: 3px solid var(--site-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--site-space-2);
  top: -3rem;
  background: var(--site-accent);
  color: var(--site-accent-contrast);
  padding: var(--site-space-1) var(--site-space-2);
  border-radius: 0 0 8px 8px;
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

.container {
  max-width: var(--site-max-width);
  margin-inline: auto;
  padding-inline: var(--site-space-2);
}

@media (min-width: 48rem) {
  .container {
    padding-inline: var(--site-space-4);
  }
}

/* ---------------------------------------------------------------- */
/* Header / navigation                                               */
/* ---------------------------------------------------------------- */

.site-header {
  position: relative;
  border-bottom: 1px solid var(--site-border);
  background: var(--site-bg);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--site-space-2);
  gap: var(--site-space-2);
}

.site-logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--site-text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--site-border);
  border-radius: 0.5rem;
  cursor: pointer;
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--site-text);
  border-radius: 2px;
}

.nav-toggle__icon {
  position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__icon::before {
  top: -6px;
}

.nav-toggle__icon::after {
  top: 6px;
}

/* Mobile: the nav is a dropdown panel anchored to the header, not part of
   the bar's own row flow — this is what lets the logo+toggle row stay a
   single tidy line while the open menu overlays below it rather than
   pushing page content down. */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--site-bg);
  border-bottom: 1px solid var(--site-border);
  box-shadow: 0 8px 16px -12px rgb(0 0 0 / 0.2);
}

.site-nav.is-open {
  display: block;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: var(--site-space-2);
  display: flex;
  flex-direction: column;
  gap: var(--site-space-1);
}

.site-nav__list a {
  display: block;
  padding: var(--site-space-2);
  border-radius: 0.5rem;
  color: var(--site-text);
  text-decoration: none;
  font-weight: 500;
}

.site-nav__list a:hover {
  background: var(--site-surface-muted);
}

.site-nav__list a[aria-current="page"] {
  color: var(--site-accent);
  text-decoration: underline;
}

/* Desktop / tablet-wide: nav becomes a normal inline row, hamburger hidden.
   Chosen deliberately wide (60rem / 960px) so the collapsed menu stays in
   use through 768px tablet width, which is exactly the breakpoint the Wix
   reference site's navigation broke at. */
@media (min-width: 60rem) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
  }

  .site-nav__list {
    flex-direction: row;
    padding: 0;
    gap: var(--site-space-3);
  }

  .site-nav__list a {
    padding: var(--site-space-1) 0.25rem;
  }
}
/* ---------------------------------------------------------------- */
/* Footer                                                             */
/* ---------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--site-border);
  padding-block: var(--site-space-4);
  color: var(--site-text-muted);
  font-size: 0.875rem;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--site-space-2);
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.site-nav__list a[aria-current="true"] { color: var(--site-accent); text-decoration: underline; }
/* Official body text metrics, applied to the shared chrome only (CatLab body keeps 1.75). */
.site-header, .site-footer, .skip-link { line-height: 1.7; -webkit-font-smoothing: antialiased; }
/* CatLab addition: CatLab pages have positioned content (hero glow, play board) that would
   paint over the official absolutely-positioned mobile menu, so the header gets a stacking order. */
.site-header { z-index: 20; }

/* ---- from Prototype v5 lab.css: CatLab bar (breadcrumb + display switch) ---- */
:root, :root[data-theme="dark"] { --site-border-strong: #6a7c7d; --site-accent-soft: #1d3537; }
:root[data-theme="light"] { --site-border-strong: #7d8b8b; --site-accent-soft: #e3eff0; }
.theme-switch { display: inline-flex; border: 1px solid var(--site-border-strong); border-radius: 999px; overflow: hidden; font-size: 0.78rem; }
.theme-switch button { background: none; border: 0; color: var(--site-text-muted); padding: 4px 12px; cursor: pointer; font: inherit; min-height: 36px; }
.theme-switch button[aria-pressed="true"] { background: var(--site-accent-soft); color: var(--site-text); }
/* CatLab bar (breadcrumb + CatLab-only display switch), below the official header */
.lab-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 14px; }
.lab-bar .crumbs { padding-top: 0; }
.theme-switch__label { font-size: 0.78rem; color: var(--site-text-muted); margin-right: 6px; }
.lab-bar__switch { display: inline-flex; align-items: center; }

/* Breadcrumb */
.crumbs { font-size: 0.85rem; color: var(--site-text-muted); padding-top: 18px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--site-border-strong); }
.crumbs a { color: var(--site-text-muted); }


/* CHAOS-0001 addition: the official footer sits on the site surface (#121a1b dark), so the
   exhibit area (#0e1516) reads as a separate room between header and footer. */
.site-footer { background: var(--site-bg); }
.site-header, .site-footer { font-family: var(--site-font-sans); color: var(--site-text); }
.site-footer { color: var(--site-text-muted); }
/* Placeholder links (no href yet: the page is not published). Shown as plain text. */
.crumbs a:not([href]) { color: var(--site-text-muted); text-decoration: none; }
/* CHAOS-0001 addition: the exhibit keeps its 44 px touch-target rule (README), so the
   display switch (36 px in the prototype) and the skip link (43 px) are raised to 44 px here.
   Owner decision pending whether the prototype / other exhibits adopt this. */
.theme-switch button { min-height: 44px; }
.skip-link { min-height: 44px; display: inline-flex; align-items: center; }

/* Site integration: back link to the series menu (below the exhibit, above the exhibit footer). */
.lab-back { padding-top: 1.5rem; padding-bottom: 0.5rem; }
.lab-back a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--site-border-strong); color: var(--site-text); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.lab-back a:hover { background: var(--site-accent-soft); }

/* CatLab rule: breadcrumb links are 44px high targets (2026-11-27). */
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
