/* Hide-on-scroll nav. The bar slides up out of view the moment you scroll down and slides back the moment you
   scroll up. part.js toggles .is-hidden (and html.is-nav-hidden); this file is the motion.
   Markup: <header class="hosn"> <div class="hosn__bar"> logo, links, button </div> </header>

   Three looks, all measured:
   - default (Cabalar): the whole bar moves, 150ms cubic-bezier(.4,0,.2,1) (Tailwind's `transition`)
   - .hosn--spring (Sadewa): .7s Framer spring (bounce 0), and the bar turns from paper to white with a hairline once
     the page has scrolled 10px
   - .hosn--items (Truus): the bar stays, each of its items leaves on its own: translateY(-300%), .8s
     cubic-bezier(.625,.05,0,1), 75ms apart, left to right
   - data-hosn-mode="scatter" (Slush): the bar stays, its [data-hosn-item] pills fly up 300% one after another (30ms
     apart from the first, .75s slush-bounce) and drop back from the last; part.js animates them, these are the knobs
   - data-hosn-mode="listing" (our listing pages): the whole bar, .35s cubic-bezier(.2,.7,.2,1), shown under 160px,
     see-through until 24px then frosted solid, no transition under reduced motion (see the end of this file) */

.hosn {
  --hosn-dur: 150ms;
  --hosn-ease: cubic-bezier(.4, 0, .2, 1);
  --hosn-top: 0px;                      /* where the bar rests; part.js clears it fully on hide (top + height) */
  position: fixed; z-index: 50;
  top: var(--hosn-top); left: 0; right: 0;
  transition: transform var(--hosn-dur) var(--hosn-ease);
  will-change: transform;
}
/* --hosn-shift is written by part.js in px (resting top + height, so a floating bar clears the top edge too);
   -100% is the no-JS fallback */
.hosn.is-hidden { transform: translateY(var(--hosn-shift, -100%)); }

/* Sadewa: soft spring + a paper bar that whitens with a hairline once scrolled */
.hosn--spring {
  --hosn-dur: .7s;
  --hosn-ease: linear(0, .0041 1%, .0154 2%, .0326 3%, .0545 4%, .0802 5%, .1088 6%, .1396 7%, .172 8%, .2054 9%, .2395 10%, .2738 11%, .308 12%, .3419 13%, .3752 14%, .4078 15%, .4396 16%, .4704 17%, .5001 18%, .5288 19%, .5563 20%, .5827 21%, .6079 22%, .6319 23%, .6547 24%, .6764 25%, .6969 26%, .7164 27%, .7348 28%, .7522 29%, .7686 30%, .784 31%, .7985 32%, .8122 33%, .825 34%, .837 35%, .8483 36%, .8588 37%, .8687 38%, .8779 39%, .8866 40%, .8946 41%, .9022 42%, .9092 43%, .9157 44%, .9218 45%, .9275 46%, .9328 47%, .9377 48%, .9423 49%, .9466 50%, .9542 52%, .9608 54%, .9664 56%, .9713 58%, .9755 60%, .9791 62%, .9822 64%, .9848 66%, .9871 68%, .989 70%, .9906 72%, .9921 74%, .9932 76%, .9943 78%, .9951 80%, .9959 82%, .9965 84%, .997 86%, .9975 88%, .9979 90%, .9982 92%, .9985 94%, .9987 96%, .9989 98%, 1);
  --hosn-bg: #f3f3f3;
  --hosn-bg-scrolled: #fff;
  --hosn-line: #e5e5e5;
  background-color: var(--hosn-bg);
  transition: transform var(--hosn-dur) var(--hosn-ease), background-color .3s, box-shadow .3s;
}
.hosn--spring.is-scrolled { background-color: var(--hosn-bg-scrolled); box-shadow: 0 1px 0 var(--hosn-line); }

/* Truus: the items leave one by one instead of the bar */
.hosn--items {
  --hosn-dur: .8s;
  --hosn-ease: cubic-bezier(.625, .05, 0, 1);
  --hosn-stagger: 75ms;
  --hosn-items-shift: -300%;
  pointer-events: none;                 /* the empty bar never blocks clicks; its items take them */
}
.hosn--items.is-hidden { transform: none; }
.hosn--items .hosn__bar > * {
  pointer-events: auto;
  transition: transform var(--hosn-dur) var(--hosn-ease);
  transition-delay: calc(var(--hosn-i, 0) * var(--hosn-stagger));
}
.hosn--items.is-hidden .hosn__bar > * { transform: translateY(var(--hosn-items-shift)) rotate(.001deg); }

/* Slush: the pills scatter upward (part.js reads these; a [data-hosn-toggle] brings them back on hover) */
.hosn[data-hosn-mode="scatter"] {
  --hosn-scatter-shift: -300%;
  --hosn-scatter-dur: .75s;
  --hosn-scatter-stagger: 30ms;
  --hosn-scatter-ease: linear(0, .5737 7.6%, .8382 11.87%, .9463 14.19%, 1.0292 16.54%, 1.0886 18.97%, 1.1258 21.53%,
    1.137 22.97%, 1.1424 24.48%, 1.1423 26.1%, 1.1366 27.86%, 1.1165 31.01%, 1.0507 38.62%, 1.0219 42.57%, .9995 46.99%,
    .9872 51.63%, .9842 58.77%, 1.0011 81.26%, 1);       /* +14% overshoot at 24.5%, -1.6% dip at 59% */
}

@media (prefers-reduced-motion: reduce) {
  .hosn, .hosn--items .hosn__bar > * { transition-duration: 1ms; transition-delay: 0s; }
}

/* Listing look (our own single-property listing pages; 34 of them run this header), data-hosn-mode="listing":
   the whole bar slides, slower and softer than the default (.35s cubic-bezier(.2,.7,.2,1)); part.js keeps it shown
   while scrollY <= 160 and wants 4px of travel before a direction counts. It starts see-through and turns into a
   frosted solid with a hairline once the page has scrolled 24px (.is-scrolled, .3s). data-hosn-solid:
   "phone" (default) = solid from the top below 900px, where the hero photo can start right under the bar (nothing is
   ever printed over a listing photo); "always" = solid at every width; "scrolled" = see-through at the top everywhere.
   Reduced motion: no transition at all (the listing builder brief asks for none, not a fast one). */
.hosn[data-hosn-mode="listing"] {
  --hosn-dur: .35s;
  --hosn-ease: cubic-bezier(.2, .7, .2, 1);
  --hosn-fade: .3s;                                   /* see-through -> solid */
  --hosn-bg: transparent;                             /* at the top of the page */
  --hosn-solid: rgb(244 237 226 / .9);                /* once scrolled: the page's own paper, a little see-through */
  --hosn-blur: 12px;                                  /* frosted glass behind the solid bar */
  --hosn-line: rgb(28 34 27 / .14);                   /* hairline under the solid bar */
  background-color: var(--hosn-bg);
  transition: transform var(--hosn-dur) var(--hosn-ease), background-color var(--hosn-fade) ease,
    box-shadow var(--hosn-fade) ease, backdrop-filter var(--hosn-fade) ease, -webkit-backdrop-filter var(--hosn-fade) ease;
}
.hosn[data-hosn-mode="listing"].is-scrolled,
.hosn[data-hosn-mode="listing"][data-hosn-solid="always"] {
  background-color: var(--hosn-solid);
  -webkit-backdrop-filter: blur(var(--hosn-blur)) saturate(1.2); backdrop-filter: blur(var(--hosn-blur)) saturate(1.2);
}
.hosn[data-hosn-mode="listing"].is-scrolled { box-shadow: 0 1px 0 var(--hosn-line); }
.hosn[data-hosn-mode="listing"].is-hidden { box-shadow: none; }
@media (max-width: 899.98px) {
  .hosn[data-hosn-mode="listing"]:not([data-hosn-solid="scrolled"]) {
    background-color: var(--hosn-solid);
    -webkit-backdrop-filter: blur(var(--hosn-blur)) saturate(1.2); backdrop-filter: blur(var(--hosn-blur)) saturate(1.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hosn[data-hosn-mode="listing"] { transition: none; }
}
