/* The site's one header. Every rule sits under #nav and names its own colours and faces, so the
   header is the same on a page whatever that page's own styles say. Only the docs frame, which runs
   wider than the site, sets --h-wrap and --h-gut to line the header up with itself. */
#nav{--h-ink:#132338;--h-link:#52525B;--h-link-on:#3F3F46;--h-wash:rgba(0,0,0,.05);--h-bar:#fff;
  --h-bar-edge:inset 1px 0 0 rgba(0,0,0,.09),inset -1px 0 0 rgba(0,0,0,.09),inset 0 -1px 0 rgba(0,0,0,.15),inset 0 1px 0 rgba(210,210,210,.5),0 1px 0 rgba(0,0,0,.05),0 10px 24px -14px rgba(0,0,0,.25);
  --h-menu-ink:#112006;--h-menu:#fff;--h-menu-on:#F4F7EE;--h-menu-line:#D6DECB;--h-menu-edge:#C3CDB5;--h-menu-drop:rgba(19,35,56,.12);--h-here:#2E4A08;
  --h-ui:'Inter',ui-sans-serif,system-ui,sans-serif;--h-ease:cubic-bezier(.25,.46,.45,.94);
  position:sticky;top:0;z-index:60;height:64px;margin:0;padding:0;border:0;background:transparent;color:var(--h-ink);
  font:400 17px/1.62 var(--h-ui);letter-spacing:normal;text-align:left;transition:padding .5s var(--h-ease)}
:root[data-theme="dark"] #nav{--h-ink:#e7e8eb;--h-link:#a5a6ad;--h-link-on:#e7e8eb;--h-wash:rgba(255,255,255,.06);--h-bar:#1e1e23;
  --h-bar-edge:inset 0 0 0 1px #3b3b45,0 1px 3px rgba(0,0,0,.1),0 10px 24px -14px rgba(0,0,0,.6);
  --h-menu-ink:#e7e8eb;--h-menu:#2a2a31;--h-menu-on:#323239;--h-menu-line:#3b3b45;--h-menu-edge:#111114;--h-menu-drop:rgba(0,0,0,.5);--h-here:#9BCF4A}
#nav *,#nav *::before{box-sizing:border-box}
#nav a{text-decoration:none}

#nav .nav-in{display:flex;align-items:center;gap:34px;max-width:var(--h-wrap,1220px);height:64px;margin:0 auto;padding:0 var(--h-gut,clamp(20px,5vw,64px));border-radius:0;
  transition:max-width .5s var(--h-ease),height .5s var(--h-ease),border-radius .5s var(--h-ease),background-color .3s ease-out,box-shadow .3s ease-out}
/* Once the page moves, the bar lifts off it: a bevelled bar narrower than the page. */
#nav.s{padding:8px 16px 0;pointer-events:none}
#nav.s .nav-in{max-width:1040px;height:52px;padding:0 8px 0 14px;border-radius:12px;pointer-events:auto;background:var(--h-bar);box-shadow:var(--h-bar-edge)}

/* Over a sky that runs under a phone's status bar, the bar keeps clear of it. */
#nav.sky{height:calc(64px + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px)}
#nav.sky.s{padding-top:calc(8px + env(safe-area-inset-top,0px))}

/* Over a sky the open bar is the sky's: its words in ink with a white halo until the bar lifts. A phone's landing has no sky. */
@media (hover:hover) and (pointer:fine){
  #nav.sky:not(.s){--h-link:var(--h-ink);--h-link-on:#000;--h-wash:rgba(255,255,255,.3)}
  #nav.sky:not(.s) :is(.logo,.nav-l a,.themebtn){text-shadow:0 0 1px rgba(255,255,255,.6),0 0 14px rgba(255,255,255,.7)}
  /* once it lifts it is a pill, as the reference's is, and a night pill once dusk has fallen */
  #nav.sky.s .nav-in{max-width:min(760px,calc(100vw - 24px));height:56px;padding:0 8px 0 20px;border-radius:999px;
    box-shadow:0 22px 48px -22px rgba(14,34,96,.5),0 6px 16px -8px rgba(14,34,96,.24)}
  #nav.sky.s #navConnect{border-radius:999px}
  #nav.sky.s[data-tone="night"]{--h-ink:#F4F6FB;--h-link:rgba(244,246,251,.78);--h-link-on:#fff;--h-wash:rgba(178,214,240,.12);--h-bar:rgba(4,16,30,.88)}
  #nav.sky.s[data-tone="night"] .nav-in{box-shadow:inset 0 0 0 1px rgba(178,214,240,.16),0 22px 48px -22px rgba(0,0,0,.6)}
}

/* Over the open sky the wordmark stands on a small white cloud (sky/cloud.ts), gone once the bar lifts. */
#nav.sky .logo{isolation:isolate}
#nav.sky .logo > .bank{position:absolute;z-index:-1;pointer-events:none;image-rendering:pixelated;image-rendering:crisp-edges;transition:opacity .3s ease-out}
#nav.sky.s .logo > .bank{opacity:0}

/* The wordmark: the flask is drawn on a canvas inside the word, sized in em so it tracks the type. */
#nav .logo{display:flex;align-items:center;gap:0;position:relative;height:41px;margin:0 0 0 -10px;padding:0 12px 0 10px;color:var(--h-ink);
  font-size:30px;font-weight:700;line-height:1;letter-spacing:.03em;transform-origin:left center}
#nav .wm{display:inline-flex;align-items:baseline}
#nav .fslot{position:relative;display:inline-block;flex:0 0 auto;width:1em;height:1em;margin-right:6px}
/* The lockup: our flask (flask-mark.svg, its own pixels with no padding) is 1.35 cap heights tall and sits
   between the baseline and the capitals' centre, its base dipping .07em below the line as round letters do,
   and a small gap from the C. Once the page has scrolled, the word folds away and the flask stands alone. */
#nav .wm{display:inline-flex;align-items:baseline;font-size:20px}
#nav .wn{display:inline-block;max-width:5em;white-space:nowrap;font:800 1em/1 'Sora',var(--h-ui);letter-spacing:-.045em;clip-path:inset(-.2em -.2em -.3em -.2em);
  transition:max-width .5s cubic-bezier(.4,0,.2,1),clip-path .5s cubic-bezier(.4,0,.2,1),opacity .3s ease}
#nav .fslot{position:relative;top:.095em;width:.845em;height:.9855em;margin:0 .2em 0 0;align-self:baseline;transition:margin-right .5s cubic-bezier(.4,0,.2,1);
  background:url(/assets/flask-mark.svg) center/100% 100% no-repeat}
#nav #logofx{display:none}
/* at the wordmark's tight spacing Sora's r runs into the t: the pair is opened to the room the other letters have */
#nav .kern-rt{margin-right:.05em}
/* the word wipes away toward the flask and its space closes with it, so the menu glides up to the flask in
   the same motion */
#nav.s:not(.float) .wn{max-width:0;clip-path:inset(-.2em 100% -.3em -.2em);opacity:0;pointer-events:none}
#nav.s:not(.float) .fslot{margin-right:0}
@media (prefers-reduced-motion:reduce){#nav .wn,#nav .fslot{transition:none}}
#logofx{position:absolute;left:-.1em;top:50%;margin-top:-.7em;pointer-events:none;z-index:2;image-rendering:pixelated}

#nav .nav-l{display:flex;gap:4px;margin-left:auto}
#nav .nav-l a{padding:6px 10px;border-radius:8px;color:var(--h-link);font:550 14px/1.62 var(--h-ui);transition:background-color .15s,color .15s}
#nav .nav-l a:hover{background:var(--h-wash);color:var(--h-link-on)}
#nav .nav-l a[aria-current]{color:var(--h-ink)}

/* The light and dark switch wears the links' face; the negative margins undo the bar's wide gap so it
   stands with the links and the button rather than apart from both. */
#nav .themebtn{flex:0 0 auto;display:grid;place-items:center;width:36px;height:36px;margin:0 -24px 0 -26px;padding:0;border:0;border-radius:8px;
  background:none;color:var(--h-link);cursor:pointer;transition:background-color .15s,color .15s}
#nav .themebtn:hover{background:var(--h-wash);color:var(--h-link-on)}
#nav .themebtn svg{display:block;width:20px;height:20px}
#nav .themebtn .ico:last-child,:root[data-theme="dark"] #nav .themebtn .ico:first-child{display:none}
:root[data-theme="dark"] #nav .themebtn .ico:last-child{display:block}

/* The one action. Its green is the page's --cta where a page turns it (the main page takes it blue
   over a blue section), and the house green everywhere else. The ink is the menu's Demo ink: white on
   this green reads under 3:1, and every fill here, pressed and hovered too, holds 4.5:1 against it. */
#navConnect{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:9px 16px;border:0;border-radius:10px;
  background:var(--cta,#6AAA00);color:#112006;font:600 14px/1.62 var(--h-ui);cursor:pointer;
  box-shadow:inset 0 -1px 0 rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.18),0 1px 0 rgba(0,0,0,.08)}
#navConnect:hover{background:var(--cta-lift,#5E9A00)}
#navConnect:active{background:var(--cta-press,#5B9500);box-shadow:inset 0 1px 2px rgba(0,0,0,.3)}
/* On a page with no switch its place stays empty, so the links stand where they do on every other page. */
#nav .nav-l+#navConnect{margin-left:20px}

/* A bare bar has no links to stand with: the switch and the button keep to the right on their own. */
#nav.bare .themebtn{margin-left:auto}

/* Below 940px the links fold behind one button: a hairline square beside the green one, as the paper's white buttons
   are drawn, and its sheet is a paper card hanging under the bar, one row per page. */
#nav .mnu{display:none;position:static;pointer-events:auto}
#nav .mnu-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;cursor:pointer;
  color:var(--h-menu-ink);background:var(--h-menu);border:1px solid var(--h-menu-line);border-radius:14px;transition:background-color .15s}
#nav .mnu-btn:hover,#nav .mnu-btn[aria-expanded="true"]{background:var(--h-menu-on)}
#nav .mnu-btn:focus-visible{outline:2px solid var(--h-menu-ink);outline-offset:2px}
#nav .mnu-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
#nav .mnu-btn .mnu-x,#nav .mnu-btn[aria-expanded="true"] .mnu-bars{display:none}
#nav .mnu-btn[aria-expanded="true"] .mnu-x{display:block}
#nav .mnu-sheet{position:absolute;top:calc(100% + 8px);left:12px;right:12px;z-index:70;display:flex;flex-direction:column;padding:6px;
  background:var(--h-menu);border:1px solid var(--h-menu-line);border-radius:18px;box-shadow:0 18px 40px var(--h-menu-drop)}
#nav .mnu-sheet[hidden]{display:none}
#nav .mnu-sheet:not([hidden]){animation:mnu-in .18s ease-out}
@keyframes mnu-in{from{opacity:0;transform:translateY(-4px)}}
#nav .mnu-sheet a{display:flex;align-items:center;justify-content:space-between;padding:14px;border-radius:12px;color:var(--h-menu-ink);
  font:500 17px/24px 'Geist',ui-sans-serif,system-ui,sans-serif;letter-spacing:-.015em;text-decoration:none;transition:background-color .15s}
#nav .mnu-sheet a+a{position:relative}
#nav .mnu-sheet a+a::before{content:'';position:absolute;top:0;left:14px;right:14px;height:1px;background:var(--h-menu-line)}
#nav .mnu-sheet a::after{content:'';width:7px;height:7px;margin-right:4px;border-top:1.6px solid currentColor;border-right:1.6px solid currentColor;
  transform:rotate(45deg);opacity:.35}
#nav .mnu-sheet a:hover{background:var(--h-menu-on)}
#nav .mnu-sheet a[aria-current]{color:var(--h-here)}
#nav .mnu-sheet a:focus-visible{outline:2px solid var(--h-menu-ink);outline-offset:-2px}

@media(max-width:940px){
  #nav .nav-l{display:none}
  #nav .themebtn,#nav .nav-l+#navConnect{margin-left:auto}
  #nav .mnu{display:block;margin-left:8px}
  /* a phone keeps the whole logo when the page scrolls: the flask alone reads as a stray icon */
  #nav.s:not(.float) .wn{max-width:5em;clip-path:inset(-.2em -.2em -.3em -.2em);opacity:1;pointer-events:auto}
  #nav.s:not(.float) .fslot{margin-right:.2em}
}
@media(min-width:561px){#nav .mnu-sheet{left:auto;width:min(420px,calc(100% - 24px))}}
@media(max-width:560px){
  #nav .logo{gap:2px;height:39px;font-size:19px}
  /* the flask 16px wide, so on a 3x screen each of its 24 cells is two whole device pixels */
  #nav .wm{font-size:18.94px}
  #nav .themebtn{margin-right:0}
  #navConnect{padding:9px 13px;font-size:13px;background:var(--cta,#76B900)}
}
@media(max-width:380px){#navConnect{padding:8px 11px;font-size:12.5px}}
@media(prefers-reduced-motion:reduce){#nav,#nav .nav-in{transition:none}#nav .mnu-sheet:not([hidden]){animation:none}}

/* The paper bar of the redesigned pages: corgi.com's measures in the house green, the same values the
   landing's own bar uses. Geist must be loaded by the page. */
#nav.paper{--h-ink:#272625;--h-link:#272625;--h-link-on:#191919;--h-wash:rgba(25,25,25,.05);
  height:57px;padding:0;background:#F6F9F0;border-bottom:1px solid #D3DDC2;font-family:'Geist',ui-sans-serif,system-ui,sans-serif}
#nav.paper .nav-in{max-width:1280px;height:56px;padding:0 8px;gap:0;border-radius:0;background:none;box-shadow:none}
#nav.paper .nav-l{margin-left:16px;gap:0}
#nav.paper .nav-l a{padding:10px;border-radius:10px;font:500 14px/20px 'Geist',ui-sans-serif,system-ui,sans-serif;letter-spacing:-.015em}
#nav.paper .themebtn{margin:0 8px 0 auto}
#nav.paper .nav-l+#navConnect{margin-left:auto}
#nav.paper #navConnect{height:40px;padding:8px 14px;border:1px solid #366C00;border-radius:14px;background:#3F7D00;color:#fff;
  font:500 14px/22px 'Geist',ui-sans-serif,system-ui,sans-serif;letter-spacing:-.015em;box-shadow:none}
#nav.paper #navConnect:hover{background:#4A8F00}
#nav.paper .logo{height:40px;margin:0;padding:0 8px;font-size:20px}
/* The docs keep their dark reading: the same bar on the docs' own dark ground. */
:root[data-theme="dark"] #nav.paper{--h-ink:#e7e8eb;--h-link:#c9cad0;--h-link-on:#ffffff;--h-wash:rgba(255,255,255,.06);background:#19191d;border-bottom-color:#323239}
/* Over a tinted section ([data-tint], scripts/tint-nav.ts) the bar takes the section's ground, as open.cx's does
   over its guarantee, so the section runs up under it. */
#nav.paper{transition:background-color .3s ease,border-color .3s ease}
#nav.paper[data-over="blue"],:root[data-theme="dark"] #nav.paper[data-over="blue"]{background:var(--lake);border-bottom-color:var(--lake)}
