/* ==========================================================================
   The site's nav, on every page (assets/js/nav2.js turns the plain nav in each page's markup into
   it). The thinking and the research behind it: docs/navbar.md.

   - Product, Blog, Support and Settings, and the key that signs you up, each open a menu of
     their own. Every line in every menu is a page. No pictures.
   - The menus share one pane: between menus it changes size and slides across instead of closing.
   - The bar is one pane of the homepage's glass, not a toolbar: a hairline, a white rim, a soft
     shadow. Once you scroll it draws in to a capsule round its contents.
   - One soft marker slides to whatever the pointer is on, and rests on where you are.
   - The key is the inverse of the glass: black on paper glass, paper on smoked glass.
   - On a phone the menu is the same pane, listing the pages.
   ========================================================================== */
/* until the script has run, the plain links are held back so they aren't seen and then swapped. If it never
   runs they show after a moment, and the page still has its nav */
.nav:not(.nav--2) :is(.nav__links, .nav__login) { visibility: hidden; animation: n2-plain 0s 2.5s forwards; }
@keyframes n2-plain { to { visibility: visible; } }
.nav.nav--2 {
  /* its own faces, whatever the page under it sets (the workspace reads in another sans) */
  --f-sans: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --f-display: "Archivo ExtraCondensed", "Arial Narrow", ui-sans-serif, sans-serif;
  --n2-glass: rgba(255, 255, 255, .66); --n2-pop: #FFFDF8; --n2-line: rgba(23, 19, 15, .1); --n2-rim: rgba(255, 255, 255, .86);
  --n2-ink: #17130F; --n2-mute: rgba(23, 19, 15, .64); --n2-soft: rgba(23, 19, 15, .065); --n2-rule: rgba(23, 19, 15, .1);
  --n2-shadow: 0 2px 3px rgba(23, 19, 15, .05), 0 16px 26px -18px rgba(23, 19, 15, .2), 0 34px 40px -32px rgba(23, 19, 15, .34);
  --n2-spring: cubic-bezier(.2, .85, .25, 1);
  inset: 14px 0 auto;
}
.nav.nav--2[data-theme="dark"] {
  /* over a dark picture the bar is ink: a near-solid warm black, told from the picture by its edge, not by being
     lighter than it (a step lighter, it was a taupe slab). One hairline, which catches the lamp: amber along the
     top, fading down. Nearly solid, so nothing behind it shows through. Its menus are the same ink and edge */
  --n2-glass: linear-gradient(rgba(30, 22, 13, .86), rgba(13, 10, 7, .9)); --n2-pop: #17120D; --n2-line: rgba(255, 214, 140, .15); --n2-rim: rgba(255, 214, 140, 0);
  --n2-ink: #F6F2E8; --n2-mute: rgba(246, 242, 232, .7); --n2-soft: rgba(255, 216, 120, .1); --n2-rule: rgba(255, 226, 170, .12);
  --n2-shadow: inset 0 1px 0 rgba(255, 206, 110, .38), 0 16px 32px -14px rgba(0, 0, 0, .85), 0 0 40px -18px rgba(255, 190, 80, .28);
}

/* ---- the pane */
.nav.nav--2 .nav__bar {
  width: min(1060px, calc(100% - 28px)); height: 60px; padding: 0 10px 0 18px; grid-template-columns: 1fr auto 1fr;
  border: 0; border-radius: 20px; background: var(--n2-glass); color: var(--n2-ink);
  box-shadow: 0 0 0 1px var(--n2-line), 0 0 0 3px var(--n2-rim), var(--n2-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.7); backdrop-filter: blur(22px) saturate(1.7);
  transition: width .55s var(--n2-spring), height .4s var(--n2-spring), background-color .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
/* drawn in, it keeps room between the wordmark and the first menu: it narrows, it doesn't crowd. Only its
   width changes: at the same height nothing in it moves, so it reads as the same bar drawing in */
.nav.nav--2.is-tight .nav__bar { width: min(960px, calc(100% - 28px)); }
/* (said again for the dark state: the homepage's own layer sets the dark bar's colour with more weight than the rule above) */
.nav.nav--2[data-theme="dark"] .nav__bar { border: 0; background: var(--n2-glass); box-shadow: 0 0 0 1px var(--n2-line), 0 0 0 3px var(--n2-rim), var(--n2-shadow); }
.nav.nav--2 .nav__bar::after { left: 20px; right: 20px; bottom: 0; height: 2px; opacity: 0; transition: opacity .3s; }
.nav.nav--2.is-tight .nav__bar::after { opacity: .9; }
.nav.nav--2 .brand__mark { width: 54px; height: 33px; }
.nav.nav--2 .brand__word { font-size: 23px; }

/* ---- the links: no tray, one marker that moves */
.n2__links { position: relative; display: flex; align-items: center; gap: 2px; font: 600 15px/1 var(--f-sans); letter-spacing: -.004em; }
.n2__top { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px 0 14px; border: 0; border-radius: 11px; background: none; font: inherit; letter-spacing: inherit; color: var(--n2-mute); white-space: nowrap; cursor: pointer; transition: color .16s; -webkit-tap-highlight-color: transparent; }
.n2__top:hover, .n2__top[aria-expanded="true"], .n2__top.is-here { color: var(--n2-ink); }
.n2__top svg { width: 9px; height: 6px; margin-top: 1px; opacity: .5; transition: transform .3s var(--n2-spring), opacity .16s; }
.n2__top[aria-expanded="true"] svg { transform: rotate(180deg); opacity: .9; }
.n2__mark { position: absolute; z-index: 0; left: 0; top: 50%; width: 10px; height: 38px; margin-top: -19px; border-radius: 11px; background: var(--n2-soft); opacity: 0; pointer-events: none;
  transition: transform .42s var(--n2-spring), width .42s var(--n2-spring), opacity .2s, background-color .35s; }
.n2__mark.is-on { opacity: 1; }
.n2__mark.is-set { transition: opacity .2s, background-color .35s; }

/* ---- Log in, and the key (people coming back look for Log in along the bar: it is there, and in the key's menu) */
.nav.nav--2 .nav__actions { gap: 4px; }
.nav.nav--2 .nav__login { display: inline-flex; align-items: center; height: 40px; padding: 0 13px; border-radius: 12px; font: 600 15px/1 var(--f-sans); color: var(--n2-mute); opacity: 1; transition: color .16s, background-color .16s; }
.nav.nav--2 .nav__login:hover { color: var(--n2-ink); background: var(--n2-soft); }
.nav.nav--2 .nav__cta {
  --h: 40px; display: inline-flex; align-items: center; gap: 8px; height: var(--h); margin: 0; padding: 0 15px 0 16px; border: 0; border-radius: 12px; overflow: visible;
  font: 700 14.5px/1 var(--f-sans); color: #FBF8F0; background: linear-gradient(#2B2620, #17130F);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 -1px 0 rgba(0, 0, 0, .5), 0 1px 2px rgba(23, 19, 15, .3), 0 8px 16px -8px rgba(23, 19, 15, .55);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .35s, color .35s;
}
.nav.nav--2 .nav__cta:hover, .nav.nav--2[data-open="signup"] .nav__cta { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .5), 0 2px 3px rgba(23, 19, 15, .3), 0 12px 20px -8px rgba(23, 19, 15, .6); }
.nav.nav--2 .nav__cta:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(23, 19, 15, .4); }
.nav.nav--2 .nav__cta svg { width: 13px; height: 13px; }
.nav.nav--2[data-theme="dark"] .nav__cta { color: #17130F; border: 0; background: linear-gradient(#FFFDF8, #EAE4D4); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(23, 19, 15, .18), 0 10px 20px -10px rgba(0, 0, 0, .8); }
.nav.nav--2 .nav__menu { display: none; width: 42px; height: 42px; border-radius: 12px; color: var(--n2-ink); transition: background-color .16s; }
.nav.nav--2 .nav__menu:hover, .nav.nav--2 .nav__menu[aria-expanded="true"] { background: var(--n2-soft); }
.nav.nav--2 .nav__menu i { left: 12px; right: 12px; height: 1.75px; border-radius: 2px; }
.nav.nav--2 .me__btn { border-radius: 12px; }

/* ---- the menus: one pane under the bar that changes size and place between them. It is solid:
   a menu has to be read, and glass that changes size while it blurs is drawn late by some browsers */
.n2__pop { position: absolute; z-index: 2; left: 0; top: 72px; width: var(--w, 320px); height: var(--h, 160px); overflow: hidden; transform: translate3d(var(--x, 0px), -8px, 0); border-radius: 20px;
  background: var(--n2-pop); color: var(--n2-ink); box-shadow: 0 0 0 1px var(--n2-line), 0 0 0 3px var(--n2-rim), 0 2px 3px rgba(23, 19, 15, .05), 0 24px 40px -20px rgba(23, 19, 15, .34), 0 50px 60px -40px rgba(23, 19, 15, .4);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .44s var(--n2-spring), width .44s var(--n2-spring), height .44s var(--n2-spring), opacity .16s, visibility 0s .16s, background-color .35s, color .35s; }
.nav.nav--2.is-open .n2__pop { opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(var(--x, 0px), 0, 0); transition: transform .44s var(--n2-spring), width .44s var(--n2-spring), height .44s var(--n2-spring), opacity .2s, visibility 0s, background-color .35s, color .35s; }
.n2__pop.is-set { transition: opacity .2s, visibility 0s !important; }      /* opening: it appears where it belongs; it only travels between menus */
.n2__panel { position: absolute; left: 0; top: 0; width: 320px; padding: 8px; opacity: 0; visibility: hidden; transform: translate3d(var(--dx, 0px), 0, 0); transition: opacity .16s, transform .44s var(--n2-spring), visibility 0s .2s; }
.n2__panel.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .24s .06s, transform .44s var(--n2-spring), visibility 0s; }
.n2__panel--product, .n2__panel--signup { width: 316px; }
.n2__panel--blog { width: 372px; }
.n2__panel--support { width: 372px; }
.n2__panel--settings { width: 304px; }
.n2__panel a { color: inherit; text-decoration: none; }
.n2__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; transition: background-color .14s; }
.n2__row:hover, .n2__row:focus-visible, .n2__row[aria-current] { background: var(--n2-soft); }
.n2__row b { display: block; font: 650 15px/1.3 var(--f-sans); letter-spacing: -.008em; }
.n2__row small { display: block; margin-top: 2px; font: 400 13.5px/1.4 var(--f-sans); color: var(--n2-mute); text-wrap: pretty; }
.n2__row > svg { width: 13px; height: 13px; opacity: 0; transform: translateX(-4px); transition: opacity .16s, transform .25s var(--n2-spring); }
.n2__row:hover > svg, .n2__row:focus-visible > svg { opacity: .7; transform: none; }
.n2__k { margin: 0; padding: 8px 12px 4px; font: 600 11.5px/1.4 var(--f-sans); letter-spacing: .09em; text-transform: uppercase; color: var(--n2-mute); }
.n2__rule { height: 1px; margin: 6px 12px; background: var(--n2-rule); }
.n2__list { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.n2__list a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; padding: 7px 12px; border-radius: 11px; overflow: hidden; font: 500 14.5px/1.35 var(--f-sans); text-wrap: pretty; transition: background-color .14s; }
.n2__list a:hover, .n2__list a:focus-visible, .n2__list a[aria-current] { background: var(--n2-soft); }
[data-n2-fill][hidden] { display: none; }

/* ---- a phone: the same pane, listing the pages */
.nav.nav--2 .nav__sheet { display: block; width: min(960px, calc(100% - 28px)); max-height: calc(100dvh - 100px); margin-top: 10px; padding: 10px; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 22px;
  background: var(--n2-pop); color: var(--n2-ink); box-shadow: 0 0 0 1px var(--n2-line), 0 0 0 3px var(--n2-rim), 0 24px 40px -20px rgba(23, 19, 15, .34), 0 50px 60px -40px rgba(23, 19, 15, .4); animation: n2-sheet .34s var(--n2-spring); }
.nav.nav--2 .nav__sheet[hidden] { display: none; }
@keyframes n2-sheet { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
.nav.nav--2 .nav__sheet a { padding: 0; border: 0; font: inherit; color: inherit; }
.nav.nav--2 .nav__sheet .n2s__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border-radius: 14px; font: 600 18px/1.25 var(--f-sans); }
.nav.nav--2 .nav__sheet .n2s__row svg { width: 13px; height: 13px; opacity: .45; }
.nav.nav--2 .nav__sheet .n2s__row[aria-current], .nav.nav--2 .nav__sheet a:active { background: var(--n2-soft); }
.nav.nav--2 .nav__sheet > a[href="/login"], .nav.nav--2 .nav__sheet > .nav__sheet-out { display: flex; align-items: center; justify-content: center; height: 48px; margin-top: 10px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--n2-line); font: 600 16px/1 var(--f-sans); color: var(--n2-ink); }
.nav.nav--2 .nav__sheet > .nav__sheet-cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; margin-top: 8px; border: 0 !important; border-radius: 14px; font: 700 16px/1 var(--f-sans) !important; color: #FBF8F0; background: linear-gradient(#2B2620, #17130F); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 8px 16px -8px rgba(23, 19, 15, .55); }
.nav.nav--2[data-theme="dark"] .nav__sheet > .nav__sheet-cta { color: #17130F; background: linear-gradient(#FFFDF8, #EAE4D4); box-shadow: inset 0 1px 0 #fff; }
.nav.nav--2 .nav__sheet > .nav__sheet-me { display: grid !important; padding: 10px 12px 14px !important; }
/* dark, the menus and the phone's sheet are the bar's ink with the bar's edge: the hairline, the lamp along the top */
.nav.nav--2[data-theme="dark"] :is(.n2__pop, .nav__sheet) { box-shadow: 0 0 0 1px var(--n2-line), inset 0 1px 0 rgba(255, 206, 110, .3), 0 24px 40px -16px rgba(0, 0, 0, .85), 0 50px 60px -30px rgba(0, 0, 0, .9); }

@media (max-width: 980px) { .n2__top { padding: 0 9px 0 10px; } .nav.nav--2 .nav__bar { padding-left: 14px; } .nav.nav--2 .nav__login { padding: 0 9px; } }
@media (max-width: 800px) {
  .nav.nav--2 .nav__bar, .nav.nav--2.is-tight .nav__bar { width: min(960px, calc(100% - 28px)); height: 56px; grid-template-columns: 1fr auto; padding: 0 7px 0 14px; }
  .n2__links, .n2__pop, .nav.nav--2 .nav__login { display: none; }
  .nav.nav--2 .nav__menu { display: block; }
  .nav.nav--2 .nav__actions { gap: 6px; }
  .nav.nav--2 .brand__mark { width: 49px; height: 30px; }
  .nav.nav--2 .brand__word { font-size: 21px; }
}
@media (min-width: 801px) { .nav.nav--2 .nav__sheet { display: none; } }
@media (max-width: 380px) { .nav.nav--2 .nav__cta svg { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .nav.nav--2 .nav__bar, .n2__mark, .n2__pop, .nav.nav--2.is-open .n2__pop, .n2__panel, .n2__panel.is-on, .n2__top svg { transition-duration: .01s; }
  .nav.nav--2 .nav__sheet { animation: none; }
}
@media print { .nav.nav--2 { display: none; } }

/* ---- in the workspace the bar gets out of the way of the work: off the top as you scroll down a page, back the
   moment you scroll up (nav2.js sets .is-away). Never while the keyboard is in it */
.nav.nav--2 { transition: transform .45s var(--n2-spring); }
.nav.nav--2.is-away:not(:focus-within) { transform: translateY(calc(-100% - 44px)); }
@media (prefers-reduced-motion: reduce) { .nav.nav--2 { transition-duration: .01s; } }

/* ---- in the workspace (/app) the site's nav is the bar: it floats over the main column, beside the sidebar,
   and carries what the workspace's own bar did (search, alerts, the shortcuts). That bar keeps its place in
   the page, unseen, because the pages are laid out round it */
body.app > .nav { z-index: 40; }
html:not([data-solo]) body.app > .nav { left: 252px; }
html:not([data-solo]) body.app .top { visibility: hidden; pointer-events: none; }
html:not([data-solo]) body.app :is(.nav__cta, .nav__login, .nav__sheet) { display: none !important; }
html[data-show] body.app > .nav, html[data-solo] .nav__tools { display: none; }
.nav__tools { display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; }
.nav.nav--2 .nav__tools .ibtn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 11px; background: none; box-shadow: none; color: var(--n2-mute); transition: color .16s, background-color .16s; }
.nav.nav--2 .nav__tools .ibtn:hover { color: var(--n2-ink); background: var(--n2-soft); }
.nav.nav--2 .nav__tools .ibtn svg { width: 18px; height: 18px; }
/* beside the sidebar the workspace has no bar at all: the page is a sheet on the desk, and what the bar carried
   (search, alerts, the shortcuts) is a slim dock between the sidebar and the sheet (app-craft.css, "the sheet
   and the dock"; docs/navbar.md). The site's own links are in the sidebar, under smudges.ai */
@media (min-width: 861px) {
  html:not([data-solo]) body.app > .nav { display: none; }
}
/* a phone and a small tablet: the bar is the one every page has there (the mark, then the menu key at its end),
   and the key opens the workspace's sidebar as the pane under the bar (app.css). The site's own links are in
   that pane, not along the bar */
@media (max-width: 860px) {
  html:not([data-solo]) body.app > .nav { left: 0; }
  html:not([data-solo]) body.app > .nav .nav__bar, html:not([data-solo]) body.app > .nav.is-tight .nav__bar { height: 56px; grid-template-columns: minmax(0, 1fr) auto; padding: 0 7px 0 14px; }
  html:not([data-solo]) body.app > .nav .nav__menu { display: block; }
  html:not([data-solo]) body.app > .nav .brand { min-width: 0; overflow: hidden; }
  html:not([data-solo]) body.app > .nav :is(.n2__links, .n2__pop) { display: none; }
  html:not([data-solo]) body.app > .nav .nav__actions { gap: 4px; }
  html:not([data-solo]) body.app > .nav .nav__tools { margin-right: 0; }
}
/* a phone: the account is in the drawer (and in the sheet, on Settings), so it isn't in the bar as well, where
   it pushed the menu key off the end. (The workspace has a .me of its own, which undid the site's rule for this.)
   The list of keyboard shortcuts is no use to a thumb */
@media (max-width: 560px) {
  .nav.nav--2 .me, body.app > .nav .nav__tools [data-act="help"] { display: none; }
}
@media (max-width: 350px) {
  html:not([data-solo]) body.app > .nav .brand__mark { width: 40px; height: 25px; }
  html:not([data-solo]) body.app > .nav .brand__word { font-size: 18px; }
}

/* ---- the pages that had a top of their own (signing in and up, paying): the nav is theirs now, so their
   own mark steps aside and the page starts under the bar */
body[data-page] .auth__top, .ck-top .brand { display: none; }      /* the nav has the mark, Log in and Sign up */
body[data-page] .auth__main, .ck { padding-top: 92px; }
