/* Lab stylesheet of the chrome: the first-screen header (canonical geometry
   from css/01-header.css, served read-only), the compact logo that takes its
   place, and the dock in the bottom-right corner (comprehensive task, second
   layer). One deliberate deviation from COMPONENTS.md law 2 is marked below;
   it is slated to move into the canonical file when this home becomes canon. */

:root {
  --lab-in: 300ms;      /* capsule arrives */
  --lab-out: 240ms;     /* capsule leaves */
  --lab-ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* The floating dock: its height and its distance from the bottom edge. The
     page reserves no floor below the footer for it (COMPONENTS.md law 7,
     20.09.2026) — the pill steps aside when it meets the frame. */
  --dock-h: 48px;
  --dock-gap: max(16px, env(safe-area-inset-bottom));
}

/* Deviation. Band 720…1079.98 shows one menu item; the canonical rule matches
   the exact value `#cases`, on sub-pages the same item is `/#cases`. Move the
   `$=` form into 01-header.css later. */
@media (min-width: 720px) and (max-width: 1079.98px) {
  .hdr-menu-item[href$="#cases"] { display: flex; }
}

/* Buttons law: labels of buttons never select and never flash on tap. */
.hdr-cta, .hdr-cta *, .hdr-menu-item, .hdr-logo, .mini, .dock button, .dock button *, .dock a {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Action button hover — COMPONENTS.md 3.5: the light capsule slides in from
   the left in 300 ms, leaves in 240 ms, cubic-bezier(.4,0,.2,1); the label goes
   dark linearly for the same time. Light on light needs an edge. */
.hdr-cta { position: relative; isolation: isolate; overflow: hidden; }
.hdr-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #f7f7f7;
  box-shadow: inset 0 0 0 1px rgba(23, 23, 25, 0.16);
  clip-path: inset(0 100% 0 0 round 50px);
  transition: clip-path var(--lab-out) var(--lab-ease);
}
.hdr-cta-label { transition: color var(--lab-out) linear; }
.hdr-cta:hover::after, .hdr-cta:active::after, .hdr-cta:focus-visible::after { clip-path: inset(0 round 50px); transition-duration: var(--lab-in); }
.hdr-cta:hover .hdr-cta-label, .hdr-cta:active .hdr-cta-label, .hdr-cta:focus-visible .hdr-cta-label { color: #171719; transition-duration: var(--lab-in); }

/* Menu items of the bar: a quiet tint, the same curve; keyboard focus repeats it. */
.hdr-menu-item { border-radius: 999px; transition: background-color var(--lab-out) var(--lab-ease); }
.hdr-menu-item:hover, .hdr-menu-item:active, .hdr-menu-item:focus-visible { background-color: rgba(23, 23, 25, 0.08); transition-duration: var(--lab-in); }

/* Keyboard focus. Inside .hdr-left the canonical overflow: hidden leaves 2 px
   of room, so the logo and the menu items take an inset ring. */
.hdr-cta:focus-visible { outline: 2px solid #171719; outline-offset: 3px; }
.hdr-logo:focus-visible, .hdr-menu-item:focus-visible { outline: 2px solid #171719; outline-offset: -3px; border-radius: 999px; }

/* Without a burger the bar's right group is the action button alone. */
.hdr-cta { margin-right: 2px; }

/* ---------- Compact logo: appears where the header left ---------- */
.mini {
  position: fixed;
  top: 12px;
  left: var(--g, 24px);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 4px;
  border-radius: 999px;
  background: #eaeaea;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--lab-out) var(--lab-ease), transform var(--lab-out) var(--lab-ease), visibility 0s linear var(--lab-out);
}
.mini.is-on { opacity: 1; visibility: visible; transform: none; transition-duration: var(--lab-in), var(--lab-in), 0s; transition-delay: 0s; }
.mini-symbol { display: block; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.mini-word { display: block; width: 110px; height: 13px; }
.mini:focus-visible { outline: 2px solid #eaeaea; outline-offset: 3px; }
@media (max-width: 719.98px) {
  .mini { top: 8px; padding-right: 4px; }
  .mini-word { display: none; }
}

/* ---------- Dock: local control + global Menu ---------- */
.dock {
  position: fixed;
  right: var(--g, 24px);
  bottom: var(--dock-gap);
  z-index: 120;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 2 * var(--g, 24px));
  font-family: "Inter", sans-serif;
  color: #eaeaea;
  transition: opacity var(--lab-in) linear, transform var(--lab-in) var(--lab-ease), visibility 0s;
}
/* Over the Improving scene the dock yields to the pinned card once they meet
   (js/nav.js sets the attribute; latched for the rest of the scene). */
.dock[data-yield] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--lab-out) linear, transform var(--lab-out) var(--lab-ease), visibility 0s linear var(--lab-out);
}
.dock button { font-family: inherit; }

/* Type B capsule, dark on the page, light fill on hover (buttons law). */
.dock-menu {
  position: relative;
  isolation: isolate;
  flex: none;
  display: inline-grid;
  grid-template-areas: "label";
  place-items: center;
  height: var(--dock-h);
  min-height: var(--dock-h);
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #eaeaea;
  font: 600 13px/16px "Inter", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: color var(--lab-out) linear;
}
.dock-menu::before { content: ""; position: absolute; inset: 0; z-index: -2; border-radius: inherit; background: #171719; box-shadow: inset 0 0 0 1px rgba(234, 234, 234, 0.2); }
.dock-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #eaeaea;
  clip-path: inset(0 100% 0 0 round 999px);
  transition: clip-path var(--lab-out) var(--lab-ease);
}
.dock-menu:hover::after, .dock-menu:active::after, .dock-menu:focus-visible::after, .dock-menu[aria-expanded="true"]::after { clip-path: inset(0 round 999px); transition-duration: var(--lab-in); }
.dock-menu:hover, .dock-menu:active, .dock-menu:focus-visible, .dock-menu[aria-expanded="true"] { color: #171719; transition-duration: var(--lab-in); }
.dock-menu:focus-visible { outline: 2px solid #eaeaea; outline-offset: 3px; }
/* One trigger, two labels in one cell: Menu when closed, × Close when open
   (Alexa, 16.09.2026 — closing lives where opening does). The cell holds the
   wider label, so the pill never changes size between the states. */
.dock-menu-label { grid-area: label; display: inline-flex; align-items: center; gap: 8px; transition: opacity var(--lab-out) linear; }
.dock-menu-label--close { opacity: 0; }
.dock-menu[aria-expanded="true"] .dock-menu-label--menu { opacity: 0; }
.dock-menu[aria-expanded="true"] .dock-menu-label--close { opacity: 1; transition-duration: var(--lab-in); }
.dock-menu-x { display: block; flex: none; }

/* Floating panels open upward from the trigger, width-limited, over content. */
.dock-panel, .dock-list {
  position: absolute;
  bottom: calc(100% + 10px);
  width: min(300px, calc(100vw - 2 * var(--g, 24px)));
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  overflow: auto;
  padding: 12px 8px 8px;
  border-radius: 20px;
  background: #232325;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(234, 234, 234, 0.12);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity var(--lab-out) var(--lab-ease), transform var(--lab-out) var(--lab-ease);
}
.dock-panel { right: 0; transform-origin: right bottom; padding-top: 16px; }
.dock-panel.is-open, .dock-local.is-open .dock-list { opacity: 1; transform: none; transition-duration: var(--lab-in); }
.dock-list { left: 0; transform-origin: left bottom; width: min(320px, calc(100vw - 2 * var(--g, 24px))); }
.dock-panel ul, .dock-list ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.dock-list-title { margin: 0; padding: 0 12px 8px; font: 500 11px/14px "Inter", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: #a8a8ad; }
.dock-route, .dock-item {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #eaeaea;
  text-align: left;
  text-decoration: none;
  font: 500 15px/20px "Inter", sans-serif;
  cursor: pointer;
  transition: color var(--lab-out) linear;
}
.dock-route::after, .dock-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #eaeaea;
  clip-path: inset(0 100% 0 0 round 12px);
  transition: clip-path var(--lab-out) var(--lab-ease);
}
.dock-route:hover::after, .dock-route:active::after, .dock-route:focus-visible::after,
.dock-item:hover::after, .dock-item:active::after, .dock-item:focus-visible::after { clip-path: inset(0 round 12px); transition-duration: var(--lab-in); }
.dock-route:hover, .dock-route:active, .dock-route:focus-visible,
.dock-item:hover, .dock-item:active, .dock-item:focus-visible { color: #171719; transition-duration: var(--lab-in); }
.dock-route:focus-visible, .dock-item:focus-visible { outline: 2px solid #eaeaea; outline-offset: -2px; }
/* The active route or item carries a mark, not a second fill. */
.dock-route[aria-current]::before, .dock-item[aria-current]::before, .dock-item[aria-pressed="true"]::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.dock-count { margin-left: auto; font: 400 13px/16px "Inter", sans-serif; color: #a8a8ad; }
.dock-item:hover .dock-count, .dock-item:focus-visible .dock-item { color: inherit; }

/* Local control: the current item, the neighbours, the list. */
.dock-local {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--dock-h);
  padding: 2px;
  border-radius: 999px;
  background: #232325;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(234, 234, 234, 0.14);
}
.dock-local[hidden] { display: none; }
.dock-step {
  flex: none;
  width: 40px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #eaeaea;
  font: 400 22px/1 "Inter", sans-serif;
  cursor: pointer;
  transition: background-color var(--lab-out) var(--lab-ease), opacity var(--lab-out) linear;
}
.dock-step:hover, .dock-step:active, .dock-step:focus-visible { background: rgba(234, 234, 234, 0.1); transition-duration: var(--lab-in); }
.dock-step:focus-visible { outline: 2px solid #eaeaea; outline-offset: -3px; }
.dock-cur {
  position: relative;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 240px;
  height: 44px;
  padding: 0 32px 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #eaeaea;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--lab-out) var(--lab-ease);
}
.dock-cur:hover, .dock-cur:active, .dock-cur:focus-visible, .dock-cur[aria-expanded="true"] { background: rgba(234, 234, 234, 0.1); transition-duration: var(--lab-in); }
.dock-cur:focus-visible { outline: 2px solid #eaeaea; outline-offset: -3px; }
.dock-k { flex: none; padding: 0 2px 0 14px; font: 500 10px/12px "Inter", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: #a8a8ad; }
.dock-cur-n { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/16px "Inter", sans-serif; }
.dock-chev {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-30%) rotate(-135deg);
  transition: transform var(--lab-out) var(--lab-ease);
}
.dock-cur[aria-expanded="true"] .dock-chev { transform: translateY(-70%) rotate(45deg); }

@media (max-width: 719.98px) {
  .dock { gap: 6px; }
  .dock-step { display: none; }
  .dock-k { display: none; }
  .dock-cur { max-width: 46vw; padding: 0 30px 0 14px; }
  .dock-menu { padding: 0 16px; }
  /* On a phone the local list spans the gutters above the dock instead of
     hanging off its trigger, so it never leaves the viewport. */
  .dock-list { position: fixed; left: var(--g, 8px); right: var(--g, 8px); width: auto; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 58px); transform-origin: center bottom; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --lab-in: 1ms; --lab-out: 1ms; }
}

@media (forced-colors: active) {
  .hdr-cta, .dock-menu, .dock-local, .dock-panel, .dock-list, .dock-route, .dock-item, .mini { border: 1px solid ButtonText; }
  .hdr-cta::after, .dock-menu::after, .dock-route::after, .dock-item::after { display: none; }
}
