/* ============================================================================
 * Shared floating menu bar — one persistent bar across the whole copy cluster.
 *
 * It is ALWAYS visible and never plays a page-load entrance. Instead its
 * CONTENTS morph between states as you move between pages, seeded by
 * home-menubar.js so the incoming page starts in the page-you-left's state and
 * animates to its own — the bar reads as one continuous element that just
 * reconfigures:
 *
 *   home   [ ☰ | Connect ]      (index-copy.html)
 *   back   [ ‹ Home ]           (projects-copy.html)
 *   back   [ ‹ Projects ]       (case-*-copy.html)
 *
 * Going home → inner: Connect + toggle collapse away, the back pill grows in and
 * its label emerges from behind the chevron (the original Back-button text
 * reveal). Going inner → home: the reverse. This is the single source of truth
 * for the bar on every copy page (home copy included).
 * ========================================================================== */

/* The inner pages have no floating toolbar in the new design — just the bar
   above. Drop the shared docked toolbar + top-left case chevron they ship. */
.site-toolbar,
.index-chevron {
  display: none !important;
}

/* --- Glass shell ---------------------------------------------------------- */
.home-menubar {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 4px;
  flex: 0 0 auto;
  width: 202px;
  height: 58px;
  max-width: calc(100vw - 40px);
  padding: 4px;
  border-radius: 40px;
  overflow: clip;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 8px 56px 0 rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: "Inter", sans-serif;
  transition: width 0.46s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.46s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.46s cubic-bezier(0.16, 1, 0.3, 1);
}

/* The home page ships the bar in HTML, then JS wraps it in the fixed dock.
   Keep that inline first paint hidden so it never flashes in the top-left. */
.home-menubar:not(.hmb-ready) {
  opacity: 0;
  visibility: hidden;
}

.home-menubar.is-open {
  width: 302px;
  height: 300px;
  border-radius: 28px;
}
.home-menubar[data-state="back"] {
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* --- Dock wrapper: bar + standalone social circles, centred as one group -----
   The bar no longer positions itself; this fixed, centred flex row holds the
   glass bar plus three separate social circles to its right (reference layout),
   and carries the footer dock/grow transform so the whole group scales and docks
   together — the exact behaviour of the shared .site-toolbar. Over the last
   180px of scroll the group scales to --hmb-footer-scale-max and rises to dock
   centred on the footer's .site-toolbar-slot, scroll-velocity-eased. The maths
   lives in home-menubar.js (ported from components.js initToolbarDocking); it
   flips on [data-dock] only where a footer slot exists, so the home board (no
   footer) keeps the plain centred group. */
.home-menubar-dock {
  --hmb-footer-scale-max: 1.25;
  --hmb-scale: 1;
  --hmb-dock-y: 0px;
  --hmb-motion-duration: 0.34s;
  --hmb-motion-ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: fixed;
  left: 50%;
  bottom: 56px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  pointer-events: none;
}
.home-menubar-dock > * {
  pointer-events: auto;
}
.home-menubar-dock[data-dock] {
  gap: 0;
  transform: translateX(-50%) translateY(var(--hmb-dock-y)) scale(var(--hmb-scale));
  transform-origin: 50% 50%;
  transition: transform var(--hmb-motion-duration) var(--hmb-motion-ease),
    gap 0.38s var(--hmb-motion-ease);
  will-change: transform;
}
.home-menubar-dock[data-dock].is-footer-socials-visible {
  gap: 8px;
}

/* --- Standalone social buttons -------------------------------------------- */
.home-menubar-social {
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 58px;
  height: 58px;
  padding: 4px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 8px 56px 0 rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
  scale: 1;
  transform-origin: center;
  transition: opacity 0.2s var(--ease-out),
    scale 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    border-width 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-menubar-dock[data-dock] .home-menubar-social {
  width: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
  scale: 0;
  overflow: hidden;
  pointer-events: none;
}
.home-menubar-dock[data-dock].is-footer-socials-visible .home-menubar-social {
  width: 58px;
  padding: 4px;
  border-width: 1px;
  opacity: 1;
  scale: 1;
  pointer-events: auto;
}
.home-menubar-dock[data-dock].is-footer-socials-visible .home-menubar-social:nth-of-type(1) {
  transition-delay: 0ms;
}
.home-menubar-dock[data-dock].is-footer-socials-visible .home-menubar-social:nth-of-type(2) {
  transition-delay: 70ms;
}
.home-menubar-dock[data-dock].is-footer-socials-visible .home-menubar-social:nth-of-type(3) {
  transition-delay: 140ms;
}
.home-menubar-social:hover,
.home-menubar-social:focus-visible {
  outline: none;
}
.home-menubar-social-inner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 56px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.18s var(--ease-out);
}
.home-menubar-social:hover .home-menubar-social-inner,
.home-menubar-social:focus-visible .home-menubar-social-inner {
  background: rgba(255, 255, 255, 0.18);
}
.home-menubar-social img {
  display: block;
  width: 24px;
  height: 24px;
}
.home-menubar-social img.home-social-icon--x {
  box-sizing: border-box;
  padding: 4px;
}
.home-menubar-social img.home-social-icon--white {
  filter: brightness(0) invert(1);
}

.home-menubar-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

/* --- Collapsible link list (home hamburger menu) -------------------------- */
.home-menubar-menu {
  width: 100%;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: height 0.18s var(--ease-out);
}
.home-menubar.is-open .home-menubar-menu {
  pointer-events: auto;
  transition: height 0.46s
    linear(
      0, 0.0497, 0.1713, 0.3294, 0.4971, 0.6556, 0.7932, 0.9041, 0.9869, 1.0432,
      1.0767, 1.0919, 1.0935, 1.0858, 1.0727, 1.0572, 1.0416, 1.0273, 1.0152,
      1.0058, 0.999, 0.9945, 0.9921, 1
    );
}
.home-menubar-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.home-menubar-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  color: rgba(255, 255, 255, 0.86);
  font-family: "Inter", sans-serif;
  font-size: 28px;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.03em;
  text-decoration: none;
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  filter: blur(4px);
  transition: color 0.18s var(--ease-out), opacity 0.12s var(--ease-out),
    transform 0.12s var(--ease-out), filter 0.12s var(--ease-out);
}
.home-menubar.is-open .home-menubar-menu a {
  opacity: 0.5;
  transform: none;
  filter: blur(0);
  transition: color 0.18s var(--ease-out), opacity 0.22s var(--ease-out),
    transform 0.4s
      linear(
        0, 0.0933, 0.2941, 0.5168, 0.7134, 0.8635, 0.9641, 1.022, 1.049, 1.054,
        1.048, 1.037, 1.025, 1.014, 1.006, 1
      ),
    filter 0.22s var(--ease-out);
}
.home-menubar.is-open .home-menubar-menu a[aria-current="page"] {
  opacity: 1;
}
.home-menubar.is-open .home-menubar-menu a:not([aria-current="page"]):hover {
  opacity: 0.8;
}
.home-menubar.is-open .home-menubar-menu a:nth-child(1) {
  transition-delay: 0s, 55ms, 55ms, 55ms;
}
.home-menubar.is-open .home-menubar-menu a:nth-child(2) {
  transition-delay: 0s, 95ms, 95ms, 95ms;
}
.home-menubar.is-open .home-menubar-menu a:nth-child(3) {
  transition-delay: 0s, 135ms, 135ms, 135ms;
}
.home-menubar.is-open .home-menubar-menu a:nth-child(4) {
  transition-delay: 0s, 175ms, 175ms, 175ms;
}
.home-menubar.is-open .home-menubar-menu a:nth-child(5) {
  transition-delay: 0s, 215ms, 215ms, 215ms;
}
.home-menubar-menu a:first-child {
  margin-top: 16px;
}
.home-menubar-menu a:last-child {
  margin-bottom: 16px;
}
.home-menubar-menu a:nth-child(4) {
  padding-bottom: 16px;
}
.home-menubar-menu a:hover,
.home-menubar-menu a:focus-visible {
  color: #fff;
  outline: none;
}

/* --- Home-state controls: hamburger toggle + Connect ---------------------- */
/* Both collapse to nothing in the back state; the shared morph easing is the
   site's toolbar motion curve so it matches the original chevron morph. */
.home-menubar-toggle {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 48px;
  height: 48px;
  padding: 12px;
  border: 0;
  border-radius: 56px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  flex: 0 0 auto;
  transition: width 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.26s var(--ease-out), background-color 0.18s var(--ease-out);
}
.home-menubar-toggle:hover,
.home-menubar-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}
.home-menubar-connect {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 48px;
  padding: 12px 24px;
  margin-left: 0;
  border-radius: 56px;
  background: #fff;
  color: #000;
  font-family: "Inter", sans-serif;
  font-weight: 380;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.2887px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  flex: 1 1 auto;
  transition: padding 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    margin 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s var(--ease-out);
}

/* --- Back pill [ ‹ label ] — collapsed by default (home state) ------------ */
.home-menubar-back {
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 0;
  height: auto;
  padding: 4px 0;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 8px 56px 0 rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  flex: 0 0 auto;
  transition: width 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.26s var(--ease-out), background-color 0.18s var(--ease-out);
}
.home-menubar-back:hover,
.home-menubar-back:focus-visible {
  outline: none;
}
.home-menubar-back-inner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 12px 20px 12px 12px;
  border-radius: 56px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.18s var(--ease-out);
}
.home-menubar-back:hover .home-menubar-back-inner,
.home-menubar-back:focus-visible .home-menubar-back-inner {
  background: rgba(255, 255, 255, 0.18);
}
.home-menubar-back-icon {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}
.home-menubar-back-label {
  display: inline-block;
  white-space: nowrap;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-weight: 380;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.2887px;
  /* Crossfade text when swapping between sibling labels (Home ⇄ Projects). */
  transition: opacity 0.18s var(--ease-out);
}

/* --- BACK state: back pill in, home controls out -------------------------- */
.home-menubar[data-state="back"] .home-menubar-back {
  width: auto;
  padding: 4px;
  opacity: 1;
}
.home-menubar[data-state="home"] .home-menubar-back {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.home-menubar[data-state="back"] .home-menubar-toggle {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.home-menubar[data-state="back"] .home-menubar-connect {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  margin-left: 0;
  opacity: 0;
  pointer-events: none;
}
.home-menubar[data-state="back"] .home-menubar-menu {
  display: none;
}

/* Seed frame: snap to a state with every transition off, so the incoming page
   can start in the previous page's state without a flash before it animates. */
.home-menubar.mb-no-anim,
.home-menubar.mb-no-anim * {
  transition: none !important;
}

/* --- Hamburger icon ------------------------------------------------------- */
.home-menu-icon {
  display: block;
  width: 24px;
  height: 24px;
  overflow: visible;
}
.home-menu-icon-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-box: view-box;
  transform-origin: 12px 12px;
  transition: transform 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
}
.home-menubar-toggle[aria-expanded="true"] .home-menu-icon-line--top {
  transform: rotate(45deg) translateY(6px);
}
.home-menubar-toggle[aria-expanded="true"] .home-menu-icon-line--middle {
  opacity: 0;
}
.home-menubar-toggle[aria-expanded="true"] .home-menu-icon-line--bottom {
  transform: rotate(-45deg) translateY(-6px);
}

html.home-menu-lock,
body.home-menu-lock {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* Match the shared toolbar's gentler footer grow on small screens. */
@media (max-width: 820px) {
  .home-menubar-dock {
    --hmb-footer-scale-max: 1.14;
  }
  .home-menubar-dock[data-dock].is-footer-socials-visible {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-menubar-back,
  .home-menubar-toggle,
  .home-menubar-connect,
  .home-menubar-back-label {
    transition: none;
  }
  .home-menubar-social {
    transition: none;
  }
  .home-menubar-social-inner {
    transition: background 0.18s var(--ease-out);
  }
  .home-menubar-menu a,
  .home-menubar.is-open .home-menubar-menu a {
    transition: color 0.18s var(--ease-out);
    transition-delay: 0s;
  }
  .home-menubar-menu,
  .home-menubar.is-open .home-menubar-menu {
    transition: height 0.01s linear;
    transition-delay: 0s;
  }
}

/* ==========================================================================
 * Full-screen menu overlay (index home only — Figma 2439:16611)
 *
 * Opening no longer grows the bar into a panel. The bar just widens to fit
 * ✕ + a full-width Connect (the ☰→✕ morph already lives above), and the menu
 * takes over the viewport: social links pinned top-centre, the page nav
 * centred, over the dimmed/blurred board (.home-menu-backdrop). Everything is
 * scoped to `.home-menubar--overlay` / `.home-menu-overlay` so the shared flat
 * menu on index-copy.html (same file) is untouched.
 * ====================================================================== */
.home-menubar--overlay.is-open {
  width: 300px;
  height: 58px;
  border-radius: 40px;
}

/* Overlay layer. Kept out of the a11y/hit layer until open (JS also sets
   `inert`); a delayed visibility lets the items fade out before it hides. */
.home-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  font-family: "Inter", sans-serif;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.4s;
}
.home-menu-overlay.is-open {
  visibility: visible;
  transition: visibility 0s;
}

/* --- Socials: top-centre row (Figma 24px Regular, 40%) -------------------- */
.home-menu-socials {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  max-width: calc(100vw - 32px);
}
.home-menu-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 16px;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.2887px;
  white-space: nowrap;
  text-decoration: none;
  pointer-events: auto;
}

/* --- Nav: centred stack (Figma 56px Medium, current 100% / rest 40%) ------ */
.home-menu-nav {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 32px);
}
.home-menu-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  color: #fff;
  font-size: 56px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.2887px;
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
}

/* Reveal: each item rises + unblurs when the overlay opens; the target opacity
   (40%, or 100% for the current page) is set by the .is-open rules so a plain
   opacity here never fights the entrance. Staggered top-to-bottom. */
.home-menu-nav a,
.home-menu-socials a {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  transition: opacity 0.4s var(--ease-out),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.4s var(--ease-out);
}
.home-menu-overlay.is-open .home-menu-nav a,
.home-menu-overlay.is-open .home-menu-socials a {
  opacity: 0.4;
  transform: none;
  filter: blur(0);
}
.home-menu-overlay.is-open .home-menu-nav a[aria-current="page"] {
  opacity: 1;
}
.home-menu-overlay.is-open .home-menu-nav a:not([aria-current="page"]):hover,
.home-menu-overlay.is-open .home-menu-nav a:focus-visible,
.home-menu-overlay.is-open .home-menu-socials a:hover,
.home-menu-overlay.is-open .home-menu-socials a:focus-visible {
  opacity: 0.85;
  outline: none;
}
.home-menu-overlay.is-open .home-menu-socials a:nth-child(1) { transition-delay: 0.02s; }
.home-menu-overlay.is-open .home-menu-socials a:nth-child(2) { transition-delay: 0.06s; }
.home-menu-overlay.is-open .home-menu-socials a:nth-child(3) { transition-delay: 0.1s; }
.home-menu-overlay.is-open .home-menu-socials a:nth-child(4) { transition-delay: 0.14s; }
.home-menu-overlay.is-open .home-menu-nav a:nth-child(1) { transition-delay: 0.06s; }
.home-menu-overlay.is-open .home-menu-nav a:nth-child(2) { transition-delay: 0.11s; }
.home-menu-overlay.is-open .home-menu-nav a:nth-child(3) { transition-delay: 0.16s; }
.home-menu-overlay.is-open .home-menu-nav a:nth-child(4) { transition-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
  .home-menu-nav a,
  .home-menu-socials a,
  .home-menu-overlay.is-open .home-menu-nav a,
  .home-menu-overlay.is-open .home-menu-socials a {
    transition: opacity 0.18s var(--ease-out);
    transition-delay: 0s;
    transform: none;
    filter: none;
  }
}

/* Below the nav's natural width, scale the type + spacing down so the single
   socials row and the big nav never clip. */
@media (max-width: 520px) {
  .home-menu-nav a {
    font-size: 40px;
  }
  .home-menu-socials {
    gap: 4px;
  }
  .home-menu-socials a {
    font-size: 20px;
    padding: 12px 6px;
  }
}
@media (max-width: 360px) {
  .home-menu-nav a {
    font-size: 34px;
  }
  .home-menu-socials a {
    font-size: 16px;
    padding: 10px 5px;
  }
}
