/* ============================================================================
   ApexEvolv — NAV DROPDOWNS

   ADDITIVE. This file loads after mono.css and overrides nothing that already
   exists — the bar, the logo, the mobile toggle and the ground-reading header
   all behave exactly as they did. Everything here is the sub-menu and nothing
   else.

   The panel is drawn the way every other list on this site is drawn: an
   opaque ground, a 1px rule, no radius, no shadow, no wash. A floating menu
   is the one place a system like this would normally reach for a drop shadow,
   and there isn't one in the vocabulary to reach for. A hairline and a solid
   ground separate it from the page perfectly well, and the result reads as
   the bar extended downwards rather than as a widget sitting on top of it.

   OPEN STATE (26 Nov 2026, with the client's Contact dropdown brief). A
   panel is open while the pointer is over its item (:hover) or while the
   item carries .on, which nav.js sets on a click, Enter or Space and clears
   on Escape, a click elsewhere, focus moving out, or another menu opening.
   It used to open on :focus-within as well, which kept a panel up after
   Escape and let two panels show at once; that state now goes through .on,
   so aria-expanded always says what the screen shows.
   ============================================================================ */

/* ---- the bar --------------------------------------------------------------
   .nav and each item take their background by INHERITANCE rather than from a
   token. paintHeader in motion.js writes the ground colour of whatever
   section is under the bar as an inline style — #050506, #F4F3EF or #E8E6E0 —
   and a panel painted from --bg alone would sit a visible shade off the bar
   on two of those three. Inheriting means the panel is always exactly the
   bar's colour, including mid-transition as one section hands over to the
   next. */
.nav{position:relative;align-self:stretch;align-items:center;
  background-color:inherit}

/* The item is 20px TALLER than the word it contains and pulls that height
   back with a negative margin. That extra 20px is the header's own
   padding-bottom, so the hover target now reaches the bottom edge of the bar
   and the pointer can travel from the word into the panel without crossing
   dead ground and closing the menu on the way.

   Layout is untouched: the margin box is the original height, and the header
   is a flex row centring on the margin box.

   .nav and each item stretch to the header's CONTENT height — which the logo
   sets, not the nav — so that 20px lands exactly on the bar's bottom edge.
   Without the stretch the items are only as tall as an 11px label, they
   centre inside a taller row, and the panel opens three pixels up inside the
   bar. Invisible while the panel and the bar are the same colour, and
   immediately visible the moment either one changes. */
.nav__i{position:relative;display:flex;align-items:center;align-self:stretch;
  padding-bottom:20px;margin-bottom:-20px;background-color:inherit}
/* the label itself becomes the flex row, so the caret centres against the cap
   height rather than sitting on the baseline */
.nav__i > a,.nav__i > .nav__t{display:inline-flex;align-items:center;gap:7px}
/* Services and Coaching have no page of their own any more: their word in
   the bar only opens the panel. That makes it a button, not a link — and a
   button has to be stripped of its own chrome and dressed as the link it
   sits beside, or the bar shows two kinds of item. Contact joined them on
   26 Nov 2026; on the contact page it carries aria-current, and marks the
   current page the way a link in the bar does. */
.nav__t{font:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;
  color:var(--mu);letter-spacing:inherit;text-transform:inherit;line-height:inherit}
.nav .nav__t[aria-current]{color:var(--ink)}
.hdr--light .nav .nav__t[aria-current]{color:var(--onIvory)}

/* The caret is 7px, currentColor, and turns rather than swapping for a second
   glyph. It is the only new mark in the bar, so it is kept below the weight
   of the label it belongs to. The 1px nudge is optical: a chevron centred on
   the cap-height band reads high, because its visual mass is in the top half
   of its own box. */
.nav__c{width:7px;height:7px;flex:none;margin-top:1px;
  stroke:currentColor;fill:none;
  stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;opacity:.5;
  transition:transform .32s var(--e),opacity .32s var(--e)}
.nav__i:hover .nav__c,
.nav__i.on .nav__c{opacity:1;transform:rotate(180deg)}

/* ---- the panel ------------------------------------------------------------
   top:100% is the bottom of the PADDED item, which is the bottom edge of the
   bar — so the panel hangs off the rule the header already draws against the
   page rather than floating in the middle of it.

   min-width rather than width: the menu is as wide as its longest entry and
   no wider, which is what keeps it reading as small. */
.nav__d{position:absolute;top:100%;left:calc(-1 * var(--s3));z-index:81;
  min-width:262px;padding:4px 0;background-color:inherit;
  box-shadow:inset 0 0 0 1px var(--line);
  opacity:0;visibility:hidden;transform:translateY(-7px);
  transition:opacity .28s var(--e),transform .28s var(--e),
             visibility 0s linear .28s}
.hdr--light .nav__d{box-shadow:inset 0 0 0 1px var(--lineI2)}
.nav__i:hover .nav__d,
.nav__i.on .nav__d{opacity:1;visibility:visible;transform:none;
  transition:opacity .28s var(--e),transform .28s var(--e),visibility 0s}

/* An item in the right half of the bar hangs its panel from the right edge
   instead. Left-aligned, Leadership's panel runs past the viewport at around
   1100px — the bar is flush right, and a 280px menu opened from the fourth of
   six items has nowhere to go. The class is set in the markup for the items
   that are always in the right half; nav.js adds it to any panel that
   measures over the edge anyway, so a longer label later cannot reintroduce
   the bug. */
/* Since 26 Nov 2026 its right edge sits exactly on the bar's right edge
   (the content edge), rather than 24px past it. */
.nav__d--r{left:auto;right:0}

/* ---- the rows -------------------------------------------------------------
   Sentence case at the small step, NOT the bar's tracked caps. The bar is
   metadata about where you are; this is a list of pages, and it should read
   as one. Setting the children in caps as well would give the header two
   competing rows of the same object. */
.nav__d a{display:block;padding:12px var(--s3);
  font-size:var(--t-sm);font-weight:500;letter-spacing:-.005em;
  text-transform:none;color:var(--mu);white-space:nowrap;
  border-bottom:1px solid var(--line);
  transition:color .28s var(--e),background-color .28s var(--e)}
.nav__d a:last-child{border-bottom:0}
.nav__d a:hover,.nav__d a:focus-visible{color:var(--gold);
  background-color:var(--bg2)}
.nav__d a[aria-current]{color:var(--gold)}
.hdr--light .nav__d a{color:var(--onIvoryMu);border-bottom-color:var(--lineI)}
.hdr--light .nav__d a:hover,
.hdr--light .nav__d a:focus-visible{color:var(--goldDeep);
  background-color:rgba(18,18,20,.05)}
.hdr--light .nav__d a[aria-current]{color:var(--goldDeep)}

@media(max-width:920px){.nav__d,.nav__c{display:none}}
@media(prefers-reduced-motion:reduce){
  .nav__d{transition:opacity .001ms,visibility 0s linear .001ms}
  .nav__i:hover .nav__d,
  .nav__i.on .nav__d{transition:opacity .001ms,visibility 0s}
  .nav__c{transition:none}
}

/* ============================================================================
   MOBILE INDEX — children indented under their parent

   The index went from six rows to twenty-one, which is more than a centred
   flex column can hold on a phone. Two changes handle that and nothing else
   is disturbed:

   justify-content moves to flex-start with auto margins top and bottom, which
   centres the group while it fits and lets it scroll from the top once it
   doesn't. Centring alone would clip the first rows out of reach above the
   scroll origin.

   And the parent rows step down one size. They are still an index — large,
   one per line, on hairlines — just no longer at display size, because at
   display size twenty-one of them is a scroll rather than a list.
   ============================================================================ */
.mnav{justify-content:flex-start;overflow-y:auto;overscroll-behavior:contain}
.mnav > a:first-of-type{margin-top:auto}
.mnav .mnav__at{margin-bottom:auto}
.mnav > a,.mnav > .has-sub{font-size:clamp(1.16rem,4.7vw,1.6rem);
  padding:clamp(11px,1.7vh,15px) 0}

/* A parent that owns a sub-list gives up its own rule — the sub-list closes
   the group instead, so a heading and its children read as one block rather
   than as five unrelated rows. */
.mnav > .has-sub{border-bottom:0;padding-bottom:clamp(5px,.9vh,9px)}
.mnav__sub{display:grid;padding:0 0 clamp(10px,1.6vh,16px);
  border-bottom:1px solid var(--line)}
.mnav__sub a{position:relative;display:block;
  padding:8px 0 8px var(--s3);
  font-size:var(--t-sm);font-weight:400;letter-spacing:0;color:var(--mu2)}
/* a 12px tick rather than an indent alone, so the hierarchy survives the
   moment two child labels wrap to two lines */
.mnav__sub a::before{content:"";position:absolute;left:0;top:1.05em;
  width:12px;height:1px;background:var(--line2)}
.mnav__sub a[aria-current]{color:var(--gold)}

/* ============================================================================
   MOBILE INDEX — solid ground, full height, page held still

   The client's brief of 26 Nov 2026. The panel's ground was always opaque
   once open, but the whole panel faded in, so for most of its 0.4s the
   page showed through it: the hero headline under the index.

   Opening: the ground is there from the first frame and only what is on it
   fades in, on the same 0.4s curve. Closing is unchanged, the whole panel
   fades out to the page as before; the children keep full opacity until
   it has gone, so the fade is the panel's alone.

   The bar sits on the panel while it is open and takes its white at once
   for the same reason; its type still eases across with the index.

   Height: the dynamic viewport, so the ground meets the bottom edge whether
   the browser's bars are showing or not (inset:0 stays as the fallback).
   The shadow is a guard, the ground carried on below the panel, so nothing
   can show through under it while a bar is moving.
   ============================================================================ */
.mnav.on{transition:opacity 0s,visibility 0s}
.mnav > *{opacity:0;transition:opacity 0s linear .4s}
.mnav.on > *{opacity:1;transition:opacity .4s var(--e)}
@supports(height:100dvh){.mnav{bottom:auto;height:100dvh}}
.mnav{box-shadow:0 50vh 0 0 var(--bg)}
body.mnav-open .hdr{transition:color .4s var(--e)}
/* the page held still: fixed at its own offset, which motion.js writes as
   an inline top and reads back on close. Phones only, so a window widened
   with the index open is never left unscrollable (the resize handler closes
   it too; this cannot miss). */
@media(max-width:920px){
  body.mnav-open{position:fixed;left:0;right:0;width:100%}
}
@media(prefers-reduced-motion:reduce){
  .mnav.on > *{transition:opacity .001ms}
}
