/* THE NAV, ONE COMPONENT FOR EVERY SKAIL SITE (the owner, 2026-09-30: "a standardized nav desktop and mobile
   for all SKAIL sites"): skailstudio.com, orgomedia.ai, ohthyme.com, pagesoar.com and nowlark.com.

   CANONICAL COPY: SkailSites/shared/nav.css. Each site serves a copy at /assets/nav.css, written by
   `python3 sync_shared.py install` and held to this file byte for byte by its `check`. Edit it here, never in a copy.

   The rules it keeps (the owner, 2026-10-17: rules-kit shared/admin-console.md, "Top bar", and the site
   navigation rule), in the pattern PageSoar's nav shares (frontdoor/fd_site.py nav()):
   - at most 5 items besides the logo and the call to action (check_nav_link_count.py); more destinations go in a
     dropdown, a <details class="nav-drop">, which counts as one item;
   - the call to action is the bar's one filled control, at its right end (Sign in, where a site has one, is a .quiet
     .nav-cta before it), and the phone panel ends with it; it steps out, and the pill closes up, while the page makes
     the same offer on screen (nav.js, one rule for every site);
   - one list, two places: nav.js writes the phone panel from the bar's own links and call to action, so the two
     cannot differ (a dropdown becomes a headed group there);
   - the page's own link carries aria-current="page" and is marked by a rule under its name, and a
     dropdown holding it is marked the same way (the fill, --nav-current, is an open dropdown's alone); on a page under a menu entry (a detail page below /integrations,
     an article below /articles) that entry carries aria-current="true" and marks its dropdown the same way.

   A solid pill, pinned near the top, hugging its contents; under 860px the logo, the call to action where it fits, and a three-bar toggle,
   the toggle turning to an X and opening the panel. NO BLUR AND NOTHING SEE-THROUGH (owner, 2026-10-31: "no blur
   behind the nav", "used shared logic and components!"): the pill, its menus and the phone panel are opaque and no
   part of the nav has a backdrop-filter; ohthyme.com's pill at 80% let a 20px blur smear the page through it.
   A site changes only the theme, through these custom properties, each a solid colour (defaults are a dark theme),
   and nothing else (nav_rules.js, run by check_text_fills_box.js measureNav):
     --nav-fill                                           the pill (the edge, highlight and shadow are this sheet's)
     --nav-line                                           the rules inside: a menu's edge, the phone panel's dividers, the toggle's ring
     --nav-ink                                            link and bar colour
     --nav-muted                                          a dropdown item's description, a phone group's heading
     --nav-hover                                          a link's hover background
     --nav-current                                        an open dropdown's background
     --nav-panel                                          the dropdown's and the phone panel's (solid) background
     --nav-dim                                            the page dimmed behind the open phone panel (default 72% black)
     --nav-ring                                           the keyboard focus ring
     --nav-font                                           the one font
   Markup:
     <header class="nav"><div class="navbar">
       <a class="nav-logo" href="/">…</a>
       <nav class="nav-links" aria-label="Main">
         <a href="…">…</a>                                                            (a link)
         <details class="nav-drop"><summary>Resources</summary><div class="nav-drop-panel">
           <a href="…">Guide<span class="nav-drop-d">one line on what is there</span></a> …</div></details>     (nav.js wraps "Guide" in .nav-drop-t)
         <details class="nav-drop nav-mega"><summary>Product</summary><div class="nav-drop-panel">       (a mega menu: columns, and a card)
           <div class="nav-mega-cols"><div class="nav-mega-col"><div class="nav-mega-h">Heading</div>
             <a href="…">…</a> … <a class="nav-mega-more" href="…">See all …</a></div> …</div>
           <div class="nav-mega-card">…the site's own picture and words, and at most one a.nav-mega-more…</div></div></details>
       </nav>
       <a class="nav-cta …site's button classes…" href="…">…</a>        (optional; a <button> works too)
       <button class="nav-toggle" type="button" aria-controls="nav-menu" aria-expanded="false" aria-label="Open menu">
         <span class="bar top"></span><span class="bar mid"></span><span class="bar bot"></span></button>
       <nav class="nav-menu" id="nav-menu" aria-label="Menu" hidden></nav>        (written by nav.js)
     </div></header>
   with /assets/nav.js. */

.nav {
  --nav-fill: #1c1c1e;
  --nav-edge: rgba(255, 255, 255, .14);
  --nav-line: rgba(255, 255, 255, .14);
  --nav-highlight: rgba(255, 255, 255, .22);
  --nav-shadow: 0 6px 20px rgba(0, 0, 0, .14);
  --nav-ink: #f4f4f4;
  --nav-muted: rgba(244, 244, 244, .64);
  --nav-hover: rgba(255, 255, 255, .07);
  --nav-current: rgba(255, 255, 255, .15);
  --nav-panel: #0b0b0c;
  --nav-ring: rgba(255, 255, 255, .85);
  --nav-font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  position: fixed; top: max(16px, env(safe-area-inset-top)); left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
  font-family: var(--nav-font);
}
.navbar {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 60px; max-width: 100%;
  padding: 8px 14px; border-radius: 32px; pointer-events: auto;
  background: var(--nav-fill); border: 1px solid var(--nav-edge);
  box-shadow: inset 0 1px 0 var(--nav-highlight), inset 0 -1px 0 rgba(255, 255, 255, .03), var(--nav-shadow);
}
/* The pill stays in view the whole way down the page (owner, 2026-11-22: "return it back to it always floating in view
   for the user"): never tucked, hidden or slid away on scroll. check_nav_stays.py refuses the tuck that was here. */
/* even inside the pill (orgomedia.ai items 134, 193): the logo and the call to action (the toggle on phones)
   each 15px from the pill's edge, the 14px padding plus the 1px border. */
/* No band, scrim or veil behind the pill, ever (owner, 2026-11-15: "remove the scrim everywhere! make that a rule never
   add it!"): the pill floats over the page on its own. check_no_nav_band.py refuses one in any Skail site's CSS. */
/* the wordmark never wraps */
.nav-logo { display: flex; align-items: center; gap: 10px; margin-right: 10px; flex: none; white-space: nowrap; color: var(--nav-ink); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.nav-logo img { height: 30px; width: auto; display: block; }
/* an inline SVG mark is square: width:auto would resolve it to 300px */
.nav-logo svg { height: 30px; width: 30px; display: block; flex: none; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a, .nav-menu a:not(.nav-menu-cta), .nav-drop > summary {
  padding: 10px 14px; border-radius: 24px; text-decoration: none; color: var(--nav-ink);
  font: 500 15px/1.2 var(--nav-font); white-space: nowrap; transition: background-color .18s ease;
}
.nav-links a:hover, .nav-drop > summary:hover { background: var(--nav-hover); }
/* TWO STATES, TWO MARKS (owner, 2026-11-16: on ohthyme.com an open menu and the current page looked the same). The
   page being read is marked by a rule under its name and no fill, in the bar, in a dropdown and in the phone panel;
   the fill (--nav-current) and a ring belong to an open dropdown alone, a pressed control. Neither changes a width. */
.nav-links > a:is([aria-current="page"], [aria-current="true"]), .nav-drop:has(:is([aria-current="page"], [aria-current="true"])) > summary, .nav-drop > summary[aria-current="true"],
.nav-drop-panel a:is([aria-current="page"], [aria-current="true"]) > .nav-drop-t, .nav-mega-col a:is([aria-current="page"], [aria-current="true"]), .nav-menu a:not(.nav-menu-cta):is([aria-current="page"], [aria-current="true"]) {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.nav-drop[open] > summary { background: var(--nav-current); box-shadow: inset 0 0 0 1px var(--nav-line); }
.nav a:focus-visible, .nav button:focus-visible, .nav-drop > summary:focus-visible { outline: 2px solid var(--nav-ring); outline-offset: 2px; }
/* the call to action: the bar's one filled control. Its geometry is the nav's, so every site's matches; its colour
   and type are the site's own button's (its .nav-cta rule styles the phone panel's copy too). Scoped to the bar's
   own child so a site's .btn rule (loaded after this sheet) cannot resize it. */
.navbar > .nav-cta { margin-left: 6px; white-space: nowrap; flex: none; min-height: 44px; padding: 0 20px; border-radius: 22px; }
/* THE BUTTON STEPS OUT AND THE PILL CLOSES UP (owner, 2026-11-15: "the nav should expand to show the button"; nav.js
   holds the one rule for when, for every Skail site). Away (html.nav-cta-away), the button gives back the room it
   took, a negative margin of exactly its slot (--nav-cta-slot, measured by nav.js), so the pill, which hugs its
   contents, ends at Sign in or the last link with no blank slot, and widens again when the button returns. The
   button's own box never changes, so its words are never clipped. A .quiet action (Sign in) always stays. */
html.nav-cta-away .navbar > .nav-cta:not(.quiet) { margin-right: calc(-1 * var(--nav-cta-slot, 0px)); opacity: 0; visibility: hidden; pointer-events: none; }
html.nav-cta-moves .navbar > .nav-cta:not(.quiet) { transition: margin-right .28s cubic-bezier(.2, .7, .2, 1), opacity .2s ease .08s, visibility 0s linear 0s; }
html.nav-cta-moves.nav-cta-away .navbar > .nav-cta:not(.quiet) { transition: margin-right .28s cubic-bezier(.2, .7, .2, 1), opacity .14s ease, visibility 0s linear .28s; }
/* both selectors, so this is not outranked by the away rule above it (it was: the button still slid away) */
@media (prefers-reduced-motion: reduce) { html.nav-cta-moves .navbar > .nav-cta:not(.quiet), html.nav-cta-moves.nav-cta-away .navbar > .nav-cta:not(.quiet) { transition: none; } }
/* Until nav.js has judged the page (html.nav-cta-live) the button is held folded, so a page never opens on a button
   that then leaves. Held by an animation that ends: if nav.js never runs, the button is back after 4s; where scripting
   is off it is never held. */
@media (scripting: enabled) and (min-width: 861px) {
  html:not(.nav-cta-live) .navbar > .nav-cta:not(.quiet) { animation: nav-cta-wait 4s step-end; }
}
@keyframes nav-cta-wait { from { max-width: 0; padding-left: 0; padding-right: 0; margin-left: -8px; border-width: 0; opacity: 0; visibility: hidden; } }

/* a dropdown: one item in the bar, its links in a panel under it */
.nav-drop { position: relative; }
.nav-drop > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-drop > summary::after {
  content: ""; width: 6px; height: 6px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}
.nav-drop[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.nav-drop-panel {
  position: absolute; top: calc(100% + 16px); left: 0; width: max-content; min-width: 280px; max-width: calc(100vw - 32px);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  border-radius: 20px; border: 1px solid var(--nav-line); background: var(--nav-panel); box-shadow: var(--nav-shadow);
}
.nav-drop:not([open]) > .nav-drop-panel { display: none; }
/* each item is two lines, its title and one line of description (owner, 2026-10-31: "nav links, with horrible
   wrapping"): the panel is as wide as its longest line, never a fixed cap the words wrap inside; a description stays
   within NAV_DESC_MAX characters (nav_rules.js), so the panel stays on the screen, and measureNav counts the lines. */
.nav-links .nav-drop-panel a { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; white-space: nowrap; }
.nav-drop-d { color: var(--nav-muted); font-size: 13.5px; font-weight: 400; line-height: 1.35; }

/* A MEGA MENU (owner, 2026-11-22: "Add megas to shared", so pagesoar.com and nowlark.com draw this bar too): a dropdown
   whose panel is a sheet under the pill, centred on it, holding columns of links under a heading each, a "See all"
   link (.nav-mega-more) under a column, and one card on the right whose inside is the site's own. It is a .nav-drop in
   every other way: one item in the bar, one open at a time, solid, on the screen, every link one line (measureNav).
   On a phone nav.js writes it as a group folded under its name, open on the page being read, a column past the
   first under its heading, and a link only the card carries joins the group. */
.nav-mega { position: static; }
.nav-mega > .nav-drop-panel {
  left: 50%; width: min(1040px, calc(100vw - 32px)); margin-left: calc(-1 * min(520px, 50vw - 16px)); min-width: 0; max-width: none;
  max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; border-radius: 28px;
}
.nav-mega > .nav-drop-panel:has(> .nav-mega-card) { grid-template-columns: minmax(0, 1fr) 335px; }
.nav-mega-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 24px; }
.nav-mega-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.nav-mega-h { padding: 0 14px 10px; color: var(--nav-muted); font: 500 13px/1.2 var(--nav-font); }
.nav-links .nav-mega .nav-mega-col a { padding: 10px 14px; }
.nav-links .nav-mega .nav-drop-panel a:hover { background: var(--nav-hover); }
.nav-links .nav-mega a.nav-mega-more { flex-direction: row; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; }
.nav-mega-more::after { content: "\2192"; flex: none; }
.nav-mega-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; padding-right: 6px; color: var(--nav-ink); }
.nav-links .nav-mega .nav-mega-card a.nav-mega-more { margin: 0 0 0 -14px; }
/* a window too narrow for the columns beside a 335px card keeps the columns and the card's link, and drops its picture:
   every destination stays, and no link is squeezed past its column (measureNav: 'nav menu link cut') */
@media (max-width: 1100px) {
  .nav-mega > .nav-drop-panel:has(> .nav-mega-card) { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .nav-mega-card > :not(.nav-mega-more) { display: none; }
  .nav-mega-card { padding: 0; }
  .nav-links .nav-mega .nav-mega-card a.nav-mega-more { margin: 0; }
}

.nav-toggle {
  display: none; position: relative; width: 48px; height: 48px; border-radius: 50%; padding: 0; flex: none;
  border: 1px solid var(--nav-line); background: transparent; cursor: pointer;
}
.nav-toggle .bar {
  position: absolute; height: 1.5px; border-radius: 1px; background: var(--nav-ink);
  transition: transform .3s ease, top .3s ease, opacity .2s ease;
}
.nav-toggle .top, .nav-toggle .bot { width: 22px; left: calc(50% - 11px); }
.nav-toggle .top { top: 17px; }
.nav-toggle .mid { width: 13px; right: 12px; top: calc(50% - .75px); }
.nav-toggle .bot { top: 29px; }
.nav-toggle[aria-expanded="true"] .top { top: calc(50% - .75px); transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bot { top: calc(50% - .75px); transform: rotate(-45deg); }
.nav-toggle[aria-expanded="true"] .mid { opacity: 0; }
/* the phone panel: the bar's links in a list that scrolls (a dropdown as a headed group), then a foot that stays in
   view with the calls to action at full width (nav.js writes both parts) */
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: -1px; right: -1px; padding: 10px 4px; display: none; flex-direction: column;
  max-height: calc(100dvh - 120px); overflow: hidden;
  border-radius: 24px; border: 1px solid var(--nav-line); background: var(--nav-panel); box-shadow: var(--nav-shadow);
  transition: opacity .2s ease, transform .2s ease;
}
/* the call to action's copy is left out: its type and colour stay the site's button's, as in the bar */
/* ONE LEFT EDGE (board, 2026-11-16: the logo, the labels and the button began at three different places): the panel's
   4px and a row's 10px put a label under the logo's left edge (the bar's 14px), and the foot's 10px puts the rule and
   the button there too, ending under the toggle's right edge */
.nav-menu a:not(.nav-menu-cta) { padding: 14px 10px; font-size: 17px; }
.nav-menu a:not(.nav-menu-cta):hover { background: var(--nav-hover); }
/* a page still holding an older nav.js (a cached, unstamped copy) writes no list: the panel itself scrolls then */
.nav-menu:not(:has(> .nav-menu-list)) { overflow-y: auto; }
.nav-menu-list { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* while more of the list is below, its last 24px fade out, over the half row nav.js leaves cut there, so a row cut at the edge reads as a list that scrolls
   (nav.js sets .nav-more; board, 2026-11-02: ohthyme.com's list looked as if it ended at "Solar and energy") */
.nav-menu-list.nav-more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
/* and while some of it is above, its first 24px fade the same way, so a row scrolled under the top edge reads the same as
   one under the bottom, never sliced (board, 2026-11-02: "About" cut in half on skailstudio.com, phone sideways) */
.nav-menu-list.nav-less { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px); mask-image: linear-gradient(to bottom, transparent, #000 24px); }
.nav-menu-list.nav-less.nav-more { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.nav-menu-foot { display: flex; flex-direction: column; gap: 10px; flex: none; margin: 10px 10px 0; padding-top: 10px; border-top: 1px solid var(--nav-line); }
/* a phone turned sideways has a short panel: the calls to action share one row there, so the links keep the height
   (board, 2026-11-02: stacked, they took 110px of a 250px panel and left ohthyme.com one link) */
@media (max-height: 500px) and (orientation: landscape) { .nav-menu-foot { flex-direction: row; } .nav-menu-foot > * { flex: 1 1 0; } }
/* groups are set apart by their heading and space, never a rule: the foot's rule is the panel's one line, so a group
   cut off at the bottom of the scrolling list can never draw a second rule beside it, and its heading peeks out to say
   the list goes on (board, 2026-11-02: two hairlines above Sign in on ohthyme.com) */
.nav-menu-group { display: flex; flex-direction: column; margin-top: 12px; }
.nav-menu-list > .nav-menu-group:first-child { margin-top: 0; }
.nav-menu-h { padding: 10px 10px 4px; color: var(--nav-muted); font: 500 13px/1.2 var(--nav-font); }
/* a mega menu on a phone: its group folds under its name, a row with a chevron, open on the page being read */
.nav-menu-sub { padding: 14px 10px 4px; color: var(--nav-muted); font: 500 13px/1.2 var(--nav-font); }
.nav-menu-fold { margin-top: 0; }
.nav-menu-fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px; border-radius: 24px; list-style: none; cursor: pointer;
  color: var(--nav-ink); font: 500 17px/1.2 var(--nav-font); white-space: nowrap;
}
.nav-menu-fold > summary::-webkit-details-marker { display: none; }
.nav-menu-fold > summary::after {
  content: ""; width: 7px; height: 7px; flex: none; margin-right: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg);
}
.nav-menu-fold[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.nav-menu-fold:has(:is([aria-current="page"], [aria-current="true"])) > summary > span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav-menu-fold > .nav-menu-rows { display: flex; flex-direction: column; padding-left: 12px; }
.nav-menu-fold:not([open]) > .nav-menu-rows { display: none; }
.nav-menu .nav-menu-cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin: 0; padding: 0 20px; border-radius: 24px; }
.nav-menu > .nav-menu-cta { width: auto; margin: 0 10px; }   /* no foot (an older nav.js): the same edge */

@media (max-width: 860px) {
  /* THE PHONE BAR: logo, the one button, the toggle (owner, 2026-11-16: "on a phone the bar never shows an action
     button"). The button is the desktop bar's own element under the same away rule (html.nav-cta-away), shown only
     where nav.js has measured that the three fit on the row (html.nav-cta-fits); until then, and where they do not
     fit, it is out of the row and unseen, and the panel's copy is the way to it. It is as tall as the 48px
     toggle, so the bar's height never changes; away, it keeps its place, so nothing in the bar moves. With the panel
     open the panel's own copy is the one on screen. A .quiet action (Sign in) is in the panel only. .navbar-scoped
     so a site's own button rule (.btn, loaded after this sheet) cannot undo any of it. */
  .navbar .nav-links, .navbar > .nav-cta.quiet { display: none; }
  .navbar > .nav-logo { margin-right: 0; }
  .navbar > .nav-cta:not(.quiet) { margin: 0 0 0 auto; min-height: 48px; padding: 0 12px; border-radius: 24px; }   /* the toggle's height (board, 2026-11-16: 44px beside 48px read as two sizes); 12px: skailstudio.com's fits a 390px phone by 1px */
  html.nav-cta-away .navbar > .nav-cta:not(.quiet) { margin-right: 0; }
  html:not(.nav-cta-fits) .navbar > .nav-cta:not(.quiet) { position: absolute; opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
  .navbar:has(.nav-menu:not([hidden])) > .nav-cta:not(.quiet) { opacity: 0; visibility: hidden; pointer-events: none; }
  .nav-toggle { display: inline-flex; }
  .navbar { width: 100%; justify-content: space-between; padding: 6px 14px; min-height: 0; }
  .nav-menu:not([hidden]) { display: flex; }
  @starting-style { .nav-menu:not([hidden]) { opacity: 0; transform: translateY(-6px); } }
  /* behind the open panel, the page is dimmed and held still; a tap on it closes the menu (nav.js) */
  .nav:has(.nav-menu:not([hidden]))::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: auto;
    background: var(--nav-dim, rgba(0, 0, 0, .72));   /* no blur, so a deeper dim: the page's own button must not read as a second one under the panel; a site whose page is as dark as the panel sets a deeper --nav-dim */
  }
  html:has(.nav-menu:not([hidden])) { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-toggle .bar, .nav-links a, .nav-menu, .nav-menu a, .nav-drop > summary, .nav-drop > summary::after { transition: none; }
}
