/* Beach Insurance: tide lane (prefix bit-). Site-wide coastal motion language.
   Tide-line progress, living wave edges, scroll reveals, stat count-up, sun glint.
   Transform/opacity only. Start-hidden states are gated behind html.bit-js (added by bit-tide.js). */

/* 1. Tide-line reading progress (fixed, aria-hidden, pointer-events:none: never blocks a click) */
.bit-tide{position:fixed;top:0;left:0;right:0;height:5px;z-index:60;pointer-events:none;overflow:hidden;opacity:0;transition:opacity .35s ease}
.bit-tide.bit-tide-on{opacity:1}
.bit-tide-win,.bit-tide-fill{position:absolute;top:0;left:0;right:0;bottom:0;will-change:transform}
.bit-tide-win{overflow:hidden;transform:translate3d(-100%,0,0)}
.bit-tide-fill{transform:translate3d(100%,0,0);
  background:linear-gradient(90deg,#D4A017 0%,#E8B93A 30%,#6FB3E0 70%,#2E90D1 100%);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='5' viewBox='0 0 24 5'%3E%3Cpath d='M0 0H24V3C20 5 16 5 12 3S4 1 0 3Z'/%3E%3C/svg%3E") repeat-x 0 0/24px 5px;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='5' viewBox='0 0 24 5'%3E%3Cpath d='M0 0H24V3C20 5 16 5 12 3S4 1 0 3Z'/%3E%3C/svg%3E") repeat-x 0 0/24px 5px}
.bit-tide-win::after{content:"";position:absolute;top:0;right:0;width:14px;height:5px;border-radius:0 3px 3px 0;
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(234,246,255,.95))}

/* 2a. Living hero wave (home.html markup): full-bleed, two layers, barely-there drift.
   48px tall = the old wave's box exactly, so the pre-existing font-swap shift scores no higher than baseline. */
.bit-hw{position:absolute;left:0;right:0;bottom:0;height:48px;overflow:hidden;pointer-events:none}
.bit-hw svg{position:absolute;left:0;bottom:0;width:200%;height:100%;display:block;will-change:transform}
.bit-hw-back{animation:bit-drift 90s linear infinite}
.bit-hw-front{animation:bit-sway 19s ease-in-out infinite alternate}
.bit-hw--sm{height:30px}
@media (min-width:768px){.bit-hw--sm{height:40px}}
.bit-hw--sm{animation:bit-fade .9s ease-out both}
@keyframes bit-fade{from{opacity:0}to{opacity:1}}
@keyframes bit-drift{from{transform:translate3d(-50%,0,0)}to{transform:translate3d(0,0,0)}}
@keyframes bit-sway{from{transform:translate3d(0,0,0)}to{transform:translate3d(-4%,0,0)}}
.bit-hw-old{display:none!important}
.bit-hw.bit-paused svg,html.bit-hidden .bit-hw svg{animation-play-state:paused}

/* 2b. Soft wave dividers between solid-colour sections (injected, absolute: zero layout shift) */
.bit-dv-host{position:relative}
.bit-dv{position:absolute;left:0;right:0;top:0;height:26px;margin:0!important;padding:0;pointer-events:none;overflow:hidden;z-index:0}
.bit-dv svg{display:block;width:100%;height:100%}
.bit-dv--flip svg{transform:scaleX(-1)}
@media (min-width:768px){.bit-dv{height:40px}}

/* 3. Scroll reveals (once; only elements below the fold at load are ever hidden) */
html.bit-js .bit-rv{opacity:0;transform:translate3d(0,var(--bit-rise,18px),0);
  transition:opacity .75s cubic-bezier(.2,.65,.3,1),transform .9s cubic-bezier(.2,.65,.3,1);transition-delay:var(--bit-d,0ms)}
html.bit-js .bit-rv.bit-in{opacity:1;transform:none}
@media (max-width:767px){html.bit-js .bit-rv{--bit-rise:12px}}
html.bit-js .bit-rv.bit-rv-sm{--bit-rise:9px}

/* 4. Stats count-up: real text stays in the DOM (screen readers read it); an aria-hidden ghost ticks over it */
.bit-ct{position:relative}
.bit-ct.bit-ct-on{color:transparent}
.bit-ct-ghost{position:absolute;top:0;left:0;right:0;bottom:0;color:var(--bit-ct-c,#0D3B6E);font-variant-numeric:tabular-nums;pointer-events:none;white-space:pre}
.bit-ct-ghost.bit-ct-final{font-variant-numeric:normal}
.bit-ct-tail{opacity:0;transition:opacity .4s ease}
.bit-ct-tail.bit-ct-show{opacity:1}

/* 5. Sun glint on the gold quote buttons (sheen sits above the gold, below the label) */
.bit-gl{position:relative;overflow:hidden;isolation:isolate}
.bit-gl-s{position:absolute;top:-20%;bottom:-20%;left:-55%;width:42%;z-index:-1;pointer-events:none;opacity:0;
  background:linear-gradient(100deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.28) 38%,rgba(255,248,225,.62) 50%,rgba(255,255,255,.28) 62%,rgba(255,255,255,0) 100%);
  transform:translate3d(0,0,0) skewX(-18deg)}
.bit-gl.bit-gl-go>.bit-gl-s,.bit-gl:hover>.bit-gl-s,.bit-gl:focus-visible>.bit-gl-s{animation:bit-glint 1.15s cubic-bezier(.45,0,.2,1) 1}
@keyframes bit-glint{0%{opacity:0;transform:translate3d(0,0,0) skewX(-18deg)}14%{opacity:1}82%{opacity:1}100%{opacity:0;transform:translate3d(390%,0,0) skewX(-18deg)}}

/* Reduced motion: composed static final state, nothing loops, nothing hidden */
@media (prefers-reduced-motion:reduce){
  .bit-hw svg,.bit-hw--sm{animation:none!important}
  html.bit-js .bit-rv{opacity:1!important;transform:none!important;transition:none!important}
  .bit-gl-s{display:none!important}
  .bit-tide{transition:none}
}
@media print{.bit-tide,.bit-gl-s{display:none!important}html.bit-js .bit-rv{opacity:1!important;transform:none!important}}
