/* ══════════════════════════════════════════════════════════════
   THE EXPANDING MENU — shared header component, every page.

   Plain-language twin of the terminal: the same powers, in
   conventional UI, so nobody has to type a command to use the
   site. Styles only; behaviour lives in menu.js.
   ══════════════════════════════════════════════════════════════ */

/* jade lives here too so this component stands alone on any page */
:root { --jade: #2ea9a1; --jade-dim: rgba(46,169,161,.16); --jade-a30: rgba(46,169,161,.30); }

/* ─────────── the plain-language action menu ─────────── */
.act-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid var(--jade-a30); border-radius: 8px; background: rgba(46,169,161,.06);
  padding: .5rem .7rem; font-family: var(--font-mono); font-size: .75rem; color: var(--jade);
}
.act-btn:hover, .act-btn[aria-expanded="true"] { border-color: var(--jade); background: rgba(46,169,161,.12); }
.act-btn__lamp {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--jade);
  box-shadow: 0 0 0 0 rgba(46,169,161,.55);
  animation: act-lamp 1.9s ease-in-out infinite;
}
.act-btn__text { letter-spacing: .14em; }
/* open: the lamp stops blinking and sits solid, so the state is legible
   without reading the label */
.act-btn[aria-expanded="true"] .act-btn__lamp {
  animation: none; box-shadow: 0 0 8px 1px rgba(46,169,161,.5);
}
@keyframes act-lamp {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px 0 rgba(46,169,161,.45); }
  50%      { opacity: .35; box-shadow: 0 0 0 0 rgba(46,169,161,0); }
}
@media (prefers-reduced-motion: reduce) {
  /* a blinking light is motion. hold it lit instead of removing it, so the
     control still reads as live. */
  .act-btn__lamp { animation: none; box-shadow: 0 0 6px 0 rgba(46,169,161,.45); }
}

.actpanel {
  position: fixed; z-index: 58; top: 3.9rem; right: var(--gutter);
  width: min(21rem, calc(100vw - 2rem));
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: rgba(13,17,24,.98);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  padding: .85rem;
  transform-origin: top right;
}
.actpanel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .actpanel { animation: actin 200ms var(--ease) both; }
  @keyframes actin { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } to { opacity: 1; transform: none; } }
}
.actpanel__k {
  font-family: var(--font-mono); font-size: .625rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--text-muted); padding: .2rem .3rem .55rem;
}
.actpanel__list { display: grid; gap: .3rem; }
.actitem {
  display: grid; grid-template-columns: 1.5rem 1fr auto; align-items: center; gap: .55rem;
  width: 100%; text-align: left;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .6rem .5rem;
}
.actitem:hover, .actitem:focus-visible { border-color: var(--jade-a30); background: rgba(46,169,161,.07); }
.actitem__g { font-family: var(--font-mono); font-size: .8125rem; color: var(--jade); text-align: center; }
.actitem__t { font-size: .875rem; color: var(--text-primary); }
.actitem__d { grid-column: 2 / -1; font-size: .75rem; color: var(--text-muted); line-height: 1.5; }
.actitem__go { font-family: var(--font-mono); font-size: .75rem; color: var(--text-faint); }
.actpanel__foot {
  margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: .6875rem; color: var(--text-faint); line-height: 1.6;
}


/* the trigger keeps its place in the header at every width; on the
   narrowest phones the word drops and the glyph carries it */
@media (max-width: 420px) {
  .act-btn__text { display: none; }
  .act-btn { padding: .5rem .55rem; }
}

/* ── grouped menu (operator 2026-09-11) ──
   Nine to twelve rows in one list was too much to read. The items fold into
   named sections that open on click and close on a second click. Sections
   are independent: opening one does not shut another, because a person
   comparing two groups should not have to fight the menu. */
.actgroup + .actgroup { border-top: 1px solid var(--jade-a30, rgba(46,169,161,.18)); }

.actgroup__h {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .7rem .2rem; background: none; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--jade); text-align: left;
}
.actgroup__h:hover { color: var(--text-primary, #f4efe2); }
.actgroup__t { flex: 1 1 auto; }
.actgroup__n { opacity: .55; font-size: .625rem; }

/* chevron: a rotating caret, so open/closed is readable without colour */
.actgroup__c {
  width: 7px; height: 7px; flex: none; margin-left: .1rem;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 180ms var(--ease, ease);
}
.actgroup__h[aria-expanded="true"] .actgroup__c { transform: rotate(225deg) translate(-2px, -2px); }
.actgroup__h[aria-expanded="true"] { color: var(--text-primary, #f4efe2); }

.actgroup__b { padding-bottom: .35rem; }

@media (prefers-reduced-motion: reduce) {
  .actgroup__c { transition: none; }
}
