/* Copied from the APA (rethinkdigitalai/apa src/webKit/webShell.css) by scripts/ask-patch-kit.mjs: change it there, never here. */
/* The website shell: the header (the floating pill nav) and the footer's bottom strip, drawn from the website preset's
   tokens below (docs/decisions/2026-11-25-shell-kit-website.md, production #1359). The markup is in webHeader.html and
   webFooterBottom.html (generated from nav.json by scripts/web-kit.mjs, stamped into each page by stamp.mjs); the open and
   collapse behaviour is the site's own script, which toggles .is-open, .is-collapsing and .is-collapsed on .floating-nav and
   aria-expanded on .nav-toggle. The rules read the host's --container, --ink and --ink-70 (page width and text colours).
   The nav tokens are the website's own and sit in the base layer of the cascade's order (this file loads before the site's
   stylesheet), so the site overrides any of them. */
:root{
  /* One fixed nav look everywhere: every page's floating nav (and the collapsed hamburger and dropdown) uses these. */
  --nav-bg: #0F1D07;
  --nav-border: rgba(255,255,255,.08);
  --nav-fg: #F3EFE7;
  --nav-highlight-bg: #F1ECE3;
  --nav-highlight-fg: #292B27;
  --nav-hover-fg: #23BB16;
}

.floating-nav{
  position: fixed; top: 1.375rem; left: 0; right: 0; z-index: 110;
  width: fit-content; margin: 0 auto;
  max-width: calc(100vw - 2.5rem);
}
.floating-nav ul{
  display:flex; align-items:center; gap:2px;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border); border-radius: 62.4375rem; padding: 0.375rem;
  box-shadow: 0 1.25rem 2.5rem rgba(17,18,26,.08);
  max-width: 100%;
  /* Was overflow-x:auto;overflow-y:hidden, from when links were full-
     width text and could genuinely overrun the pill before JS collapsed
     it to the hamburger. Icon-only buttons are compact enough now that
     this was really just clipping the hover/focus tooltip's ::after
     (which pops below the link, i.e. vertically, exactly the axis that
     was hidden) — visible on both axes so the tooltip actually shows. */
  overflow: visible;
}
.floating-nav ul::-webkit-scrollbar{ display:none; }
.floating-nav li{ position:relative; flex-shrink:0; }
.floating-nav a{
  display:inline-flex; align-items:center; justify-content:center;
  position:relative;
  padding: 0.75rem 1.25rem; border-radius: 62.4375rem;
  /* Was font-size:0 (icon-only, label surfacing only as a hover/focus
     tooltip) - per Cory's own follow-up ("add names to nav bar"), the
     label is real, always-visible text again; the ::after tooltip this
     used to rely on (further down) is removed as redundant now that the
     same text sits right there in the pill. The icon itself is gone
     again a round later ("remove icons from nav bar and side hamburger")
     - see .nav-icon below - so padding went back to a plain symmetric
     12px/20px (was asymmetric, biased for an icon that no longer sits on
     this side) and the icon-to-label gap was dropped entirely. */
  font-size:0.875rem; font-weight:600; color: var(--nav-fg); white-space:nowrap;
  /* transform here too — see main.js's dock-magnify, shared between this
     expanded pill (distance measured in X) and the collapsed dropdown
     further down (distance in Y). */
  transition: color .25s ease, background .25s ease, transform .15s ease;
}
.floating-nav a:hover{ background: var(--nav-highlight-bg); color: var(--nav-highlight-fg); }
/* Shared view-transition-name (see the @view-transition at-rule up top,
   which opts every same-origin navigation into this already) — exactly
   one link ever carries .active per page, so this is always a valid
   1:1 handoff. The browser captures the old page's highlighted pill and
   the new page's, so the highlight doesn't just disappear on one page and
   pop in already-formed on the next. */
.floating-nav a.active{
  background: var(--nav-highlight-bg); color: var(--nav-highlight-fg);
  view-transition-name: nav-active-pill;
}

/* A named ::view-transition-group by default also morphs position/size
   between the old pill and the new one (a "slide"). That was tried and
   didn't read as a slide in practice — disabling the group's own
   animation here pins it at each page's resting spot instead (no
   movement at all), and the old/new pill are cross-faded there in
   sequence instead: old fades out first, then — after it's fully gone —
   the new one fades in, rather than both dissolving into each other at
   once. */
::view-transition-group(nav-active-pill){ animation: none; }
::view-transition-old(nav-active-pill){ animation: rd-pill-fade-out .18s ease both; }
::view-transition-new(nav-active-pill){ animation: rd-pill-fade-in .22s ease .18s both; }
@keyframes rd-pill-fade-out{ from{ opacity:1; } to{ opacity:0; } }
@keyframes rd-pill-fade-in{ from{ opacity:0; } to{ opacity:1; } }

/* ---------- Per-page nav colour ----------
   There used to be a per-page system here (each page's pill tracking its
   own dominant text/background colour, articles getting their own
   pastel highlight, Contact inverting to a white bar) — all of that is
   gone now in favour of one fixed look everywhere, set once on :root
   above. Nothing needs overriding per page any more. */

/* No longer dropping .floating-nav to top:84px here — main.js's own
   navFits() check (real measured overlap between the pill and the
   logo, not a fixed viewport-width guess) already collapses it to the
   hamburger shape well before the two would actually touch, so this
   second, cruder width-only trigger was moving the still-fully-
   expanded pill down to its own row at widths where navFits() had
   already decided (correctly) that it still belongs beside the logo —
   it should stay on that same line "as always" per Cory's own
   feedback, and the JS mechanism is the one that should decide when
   that's no longer true. */
@media (max-width: 760px){
  .floating-nav{ max-width: calc(100vw - 1.5rem); }
}
@media (max-width: 640px){
  .floating-nav a{ padding: 0.625rem 1rem 0.625rem 0.75rem; gap:0.375rem; }
}
@media (max-width: 420px){
  .floating-nav a{ padding: 0.5rem 0.875rem 0.5rem 0.625rem; }
}

/* ---------- Nav collapse (hamburger + slide/fade dropdown) ----------
   Two independent triggers, one shared visual state (main.js toggles the
   same .is-collapsed class either way):
   1. Width — the pill's own content no longer fits (measured via the
      existing overflow-x:auto setup above: scrollWidth > clientWidth),
      checked on load/resize. Stays collapsed at every scroll position
      until the viewport is wide enough again.
   2. Scroll — collapses on scrolling away from the very top of the
      page regardless of width, and only returns to the full pill once
      back at scrollY 0 (not merely scrolling back up) *and* the nav
      actually fits at that width.
   The toggle button only renders while collapsed; the list itself
   switches from the horizontal pill to a top-right vertical panel that
   the button opens/closes. */
/* 44px -> 54px (and its spans/travel scaled up to match) per Cory's own
   follow-up ("make side hamburger bigger") - the button itself, not just
   the panel it opens, since that's what's actually visible most of the
   time. */
/* ~20% bigger across the board (button, lines, gap, border-radius, the
   open-state "X" translateY) per Cory's own follow-up ("make the
   hamburger bigger") - every number below scales together so the icon
   still reads as the same proportioned mark, just larger, rather than
   e.g. a bigger button with the same small lines floating in it. */
.nav-toggle{
  display:flex; align-items:center; justify-content:center; flex-direction:column; gap:0.4375rem;
  position:fixed; top:1.375rem; right:clamp(1.25rem,4vw,2.5rem); z-index:111;
  width:4.0625rem; height:4.0625rem; box-sizing:border-box;
  border-radius:1.625rem; cursor:pointer; border:0;
  background: var(--nav-bg); box-shadow: 0 1.25rem 2.5rem rgba(17,18,26,.16);
  opacity:0; visibility:hidden; pointer-events:none;
  transform: translateX(2rem);
  transition: opacity .2s ease, visibility 0s linear .2s, transform .2s ease;
}
.floating-nav.is-collapsing .nav-toggle,
.floating-nav.is-collapsed .nav-toggle{
  opacity:1; visibility:visible; pointer-events:auto;
  transform: translateX(0);
  transition: opacity .2s ease, transform .2s ease;
}
.nav-toggle:hover{ transform: scale(1.06); }
.nav-toggle span{
  display:block; height:2px; border-radius:1px; background: var(--nav-fg);
  transition: width .25s ease, transform .25s ease, opacity .2s ease;
}
.nav-toggle span:nth-child(1){ width:1.625rem; }
.nav-toggle span:nth-child(2){ width:1rem; }
.nav-toggle span:nth-child(3){ width:1.375rem; }
.floating-nav.is-open .nav-toggle span:nth-child(1){ width:1.625rem; transform: translateY(0.625rem) rotate(45deg); }
.floating-nav.is-open .nav-toggle span:nth-child(2){ opacity:0; }
.floating-nav.is-open .nav-toggle span:nth-child(3){ width:1.625rem; transform: translateY(-0.625rem) rotate(-45deg); }

/* Crossfade between the horizontal pill and the collapsed button.
   Position, flex-direction, width and overflow aren't smoothly
   animatable, so a transition-delay on them doesn't actually delay
   anything — the browser flips them the instant the class lands,
   regardless of duration/delay. That means the shape change and the
   opacity fade can't be driven by the same class toggle without a
   frame of the collapsed panel flashing at full opacity. Instead
   main.js adds a transient .is-collapsing class first (opacity-only —
   the pill fades out in place, still centered) and only swaps in
   .is-collapsed, which does the shape snap, once that fade has
   actually finished. Un-collapsing doesn't need this: the panel is
   already invisible before its shape reverts. */
.floating-nav > ul{ transition: opacity .2s ease; }
.floating-nav.is-collapsing > ul{ opacity:0; }
.floating-nav.is-collapsed > ul{
  opacity:0; visibility:hidden; pointer-events:none;
  position:fixed; top:1.375rem; right:clamp(1.25rem,4vw,2.5rem); left:auto; transform:none;
  flex-direction:column; align-items:stretch; gap:0.25rem;
  /* Was a flat min(56px,...) sized for an icon-only row - now each row
     carries its own visible label (see .floating-nav a below), so the
     panel needs to size to that text instead of a fixed icon-button
     width. auto + a min-width (rather than a flat width) lets it hug
     whichever label is longest ("Expertise") without the shorter ones
     ("Home") leaving obvious dead space down one side. */
  width:auto; min-width:11.25rem; max-width:calc(100vw - 2.5rem);
  overflow:visible; mask-image:none; -webkit-mask-image:none;
  /* Needs its own solid background now — the nav's default link colour
     is the light --nav-fg cream (set up for sitting on the dark pill),
     which would be unreadable floating bare over whatever's directly
     behind it on a light page like Home. Same dark surface as the pill
     itself, just reshaped into a vertical card instead of a horizontal
     one, so collapsed and expanded read as the one nav either way. */
  background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 1.375rem; box-shadow: 0 1.25rem 2.5rem rgba(17,18,26,.16);
  backdrop-filter:none; -webkit-backdrop-filter:none; padding:0.5rem;
  /* transform was missing from this list, so closing (dropping back to
     this rule from the open one below) snapped straight back to
     translateY(0) instantly while only opacity faded — the open
     animation slides smoothly but the close one visibly didn't.
     Included here now so it reverses the same way it opened. */
  transition: opacity .25s cubic-bezier(.22,1,.36,1), visibility 0s linear .25s, transform .3s cubic-bezier(.22,1,.36,1);
}
/* is-open: click-to-pin (main.js). is-hover-open: mouse hover, also
   main.js — driven by mouseenter/mouseleave with a short close delay
   rather than a bare CSS :hover, because :hover has no grace period:
   the pointer crossing the small gap between the button and the panel
   below it would instantly drop out of :hover and slam the menu shut
   before it could be reached. focus-within covers keyboard use, which
   doesn't have a gap-crossing problem since focus moves discretely. */
.floating-nav.is-collapsed.is-open > ul,
.floating-nav.is-collapsed.is-hover-open > ul,
.floating-nav.is-collapsed:focus-within > ul{
  opacity:1; visibility:visible; pointer-events:auto; transform: translateY(4rem);
  transition: opacity .3s cubic-bezier(.22,1,.36,1), transform .3s cubic-bezier(.22,1,.36,1);
}
.floating-nav.is-collapsed > ul li{ width:100%; }
/* width:100% is the only thing still specific to the collapsed vertical
   list — the label row itself now lives on the shared .floating-nav a
   rule above the pill uses too, so collapsed and expanded read as the
   same nav, just laid out differently. Was also justify-content:
   flex-start (left-aligning an icon+label pair against the now much
   wider row), but with the icon gone (see .nav-icon below) there's
   nothing left to left-align against, so this reverts to the shared
   rule's own centred default. */
.floating-nav.is-collapsed > ul a{ width:100%; }
/* Removed per Cory's own follow-up ("remove icons from nav bar and side
   hamburger") - both the horizontal pill and the collapsed vertical list
   are plain text labels again, no icon. display:none (not removing the
   markup) since every page's nav still carries a <span class="nav-icon">
   per link - simplest to just stop rendering it here rather than editing
   every page's HTML. */
.nav-icon{ display:none; }
@media (prefers-reduced-motion: reduce){
  .nav-toggle, .nav-toggle span, .floating-nav > ul, .floating-nav.is-collapsed > ul,
  .floating-nav > ul a{ transition:none; }
}

/* ---------- Footer bottom strip (the line under every page: copyright, LinkedIn, and Email us on the pages that show it) ---------- */
.footer-bottom{
  max-width: var(--container); margin: 1.875rem auto 0;
  display:flex; align-items:center; justify-content:space-between; gap: 1.25rem; flex-wrap:wrap;
  font-size: 0.8125rem; color: var(--ink-70); /* 6.6:1 on the page's cream (it was --ink-45, 2.95:1) */
}
.footer-bottom a{ color: inherit; }
.footer-bottom a:hover{ color: var(--ink); }
.footer-bottom span a{ margin-left:0.625rem; text-decoration:underline; text-underline-offset:0.1875rem; }
.footer-bottom .footer-hire{ font-weight:700; color: var(--ink); } /* the same ink and weight on every page (a plain .footer-hire lost to .footer-bottom a and went grey on most pages) */
