/* The nav on every page (index.html, terms/, privacy/; assets/nav.js), as flighty.com's: at the top of the page a
   bar across the content's width, the lockup on the left, the sections in the middle, Pricing on the right; once
   the page scrolls it folds into a floating capsule of just what it holds: the wordmark slides away behind the
   plane, a hairline after it, Pricing fills in, dark glass behind. The contrail under it is a reading-progress
   line. On a phone the capsule has a menu button that opens it into a card with the sections, and the language
   menu. Without the script it stays the bar at the top, and the sections show on wider screens. */
.nav { position: sticky; top: 0; z-index: 10; height: calc(72px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); pointer-events: none; }
.nav .bar { --ease: cubic-bezier(.2, .8, .2, 1); position: relative; pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: space-between; gap: 0 24px;
  width: calc(100% - 2 * var(--gutter)); max-width: calc(1120px - 2 * var(--gutter)); min-height: 56px; margin: 8px auto 0; padding: 9px 0;
  border: 1px solid transparent; border-radius: 28px; background: rgba(24, 24, 27, 0);
  transition: max-width .5s var(--ease), padding .5s var(--ease), background-color .35s, border-color .35s, box-shadow .35s, backdrop-filter .35s, -webkit-backdrop-filter .35s; }
.nav.scrolled .bar, .nav.open .bar { max-width: var(--pill, 760px); padding: 9px 8px 9px 11px; background: rgba(24, 24, 27, .74); border-color: rgba(255, 255, 255, .08);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 2px 6px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .45); }
.nav.open .bar { background: rgba(24, 24, 27, .92); }
/* the contrail: how far the page has been read, along the capsule's straight bottom edge */
.nav .bar::after { content: ""; position: absolute; left: 28px; right: 28px; bottom: -1px; height: 2px; border-radius: 2px; transform-origin: left; transform: scaleX(var(--progress, 0));
  background: linear-gradient(90deg, var(--coral), var(--crimson) 40%, var(--maroon) 75%, var(--plum)); opacity: 0; transition: opacity .35s; }
.nav.scrolled .bar::after { opacity: 1; }
.nav.open .bar::after { opacity: 0; }

/* the lockup, and once folded only its plane (the image's first 32 pixels) */
.nav .logo { flex: none; display: block; width: 157px; height: 32px; overflow: hidden; border-radius: 7px; transition: width .5s var(--ease); }
.nav .logo img { display: block; width: 157px; max-width: none; height: 32px; image-rendering: pixelated; }
.nav.scrolled .logo, .nav.open .logo { width: 32px; }

.nav .links { display: flex; align-items: center; gap: 2px; font-size: 15px; color: var(--muted); }
.nav .links::before { content: ""; width: 1px; height: 20px; margin-right: 10px; background: rgba(255, 255, 255, .14); opacity: 0; transition: opacity .35s; }
.nav.scrolled .links::before { opacity: 1; }
.nav .links a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 999px; text-decoration: none; transition: color .15s, background-color .15s; }
.nav .links a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.nav .links a::before { display: none; }

.nav .end { display: flex; align-items: center; gap: 8px; }
/* Pricing: a quiet link on the bar, the coral button in the capsule */
.nav .cta { height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; background: rgba(238, 69, 64, 0); color: var(--ink); transition: background-color .35s, color .35s, box-shadow .35s; }
.nav .cta:hover { background: rgba(255, 255, 255, .06); }
.nav.scrolled .cta, .nav.open .cta { background: var(--coral); color: #0A0A0B; box-shadow: 0 4px 14px rgba(238, 69, 64, .3); }
.nav.scrolled .cta:hover, .nav.open .cta:hover { background: #FF5A54; }

.nav .menu-btn { display: none; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.nav .menu-btn:hover { border-color: var(--muted); }
.nav .menu-btn i { grid-area: 1 / 1; width: 14px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.nav .menu-btn i:first-child { transform: translateY(-3px); }
.nav .menu-btn i:last-child { transform: translateY(3px); }
.nav.open .menu-btn i:first-child { transform: rotate(45deg); }
.nav.open .menu-btn i:last-child { transform: rotate(-45deg); }

/* the language menu, a capsule too */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font: 400 12px/1 var(--pixel); letter-spacing: .08em; color: var(--ink); user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { border-color: var(--muted); }
.lang-menu .caret { width: 0; height: 0; border-inline: 4px solid transparent; border-top: 5px solid var(--muted); transition: transform .15s; }
.lang-menu[open] .caret { transform: rotate(180deg); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; min-width: 190px; margin: 0; padding: 6px; list-style: none; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.lang-menu a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; }
.lang-menu a:hover { background: var(--raised-2); }
.lang-menu a:focus-visible { outline-offset: -2px; }
.lang-menu a[aria-current]::after { content: ""; width: 8px; height: 8px; background: var(--coral); }

/* a phone: the plane, Pricing and the menu button; the menu opens the capsule into a card below them, with each
   section beside a little pixel icon, two to a row, and the language menu at the bottom */
@media (max-width: 820px) {
  .nav .bar, .nav.scrolled .bar, .nav.open .bar { max-width: none; }
  .nav.scrolled .bar, .nav.open .bar { padding-inline: 11px 8px; }
  .nav .end { display: contents; }
  .nav .cta { order: 1; margin-left: auto; }
  .nav .menu-btn { order: 2; display: grid; margin-left: -16px; }
  .nav .links { order: 3; flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; max-height: 0; overflow: hidden; visibility: hidden;
    font-size: 16px; color: var(--ink); transition: max-height .4s cubic-bezier(.2, .8, .2, 1), padding .4s cubic-bezier(.2, .8, .2, 1), visibility 0s .4s; }
  .nav .links::before { display: none; }
  .nav .links a { padding: 12px; border-radius: 14px; }
  .nav .links a::before { content: ""; display: block; flex: none; width: 16px; height: 16px; background: var(--muted); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
  .nav .links + .end .lang-menu { order: 4; display: none; margin: 0 0 4px 4px; }
  /* its list opens downwards, over the page (upwards it ran off the top of the screen), and scrolls on a short one */
  .nav .links + .end .lang-menu ul { left: 0; right: auto; top: calc(100% + 10px); bottom: auto;
    max-height: max(200px, calc(100dvh - 340px)); overflow-y: auto; overscroll-behavior: contain; }
  .nav.open .links { max-height: 240px; padding-block: 10px 6px; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 10px; visibility: visible; transition-delay: 0s; }
  .nav.open .links + .end .lang-menu { display: block; }
}
/* the sections' icons, in the brand's pixels */
.nav .links a[href$="#how"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 8h3v3H1zM5 5h3v6H5zM9 2h3v9H9z'/%3E%3C/svg%3E"); }
.nav .links a[href$="#features"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M5 1h2v10H5zM1 5h10v2H1zM2 2h1v1H2zM9 2h1v1H9zM2 9h1v1H2zM9 9h1v1H9z'/%3E%3C/svg%3E"); }
.nav .links a[href$="#ios"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill-rule='evenodd' d='M3 0h6v12H3zM4 1v8h4V1zM5 10v1h2v-1z'/%3E%3C/svg%3E"); }
.nav .links a[href$="#notifications"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M5 1h2v1H5zM4 2h4v1H4zM3 3h6v5H3zM2 8h8v1H2zM5 10h2v1H5z'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: reduce) {
  .nav .bar, .nav .logo, .nav .links, .nav .links::before, .nav .cta, .nav .menu-btn i, .nav .bar::after { transition: none; }
}
