/* ?hx=bar (js/hx-bar.js): the trip bar, a boarding pass in the hero. Without the switch nothing here applies.
   The same card as the nav's pass: cream with a grain and a faint guilloche, notches where the pass meets the stub, a
   punched perforation down the stub's edge, the stub in light water blue. All the cutting is static gradient masks,
   the shapes Safari already draws on the nav. */

.hxb {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .06 0 0 0 0 .23 0 0 0 0 .25 0 0 0 -.42 .25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='60' viewBox='0 0 96 60'%3E%3Cg fill='none' stroke='%2319B5B8' stroke-opacity='.14' stroke-width='.6'%3E%3Cpath d='M0 30 C12 14 24 14 36 30 S60 46 72 30 S96 14 96 30'/%3E%3Cpath d='M0 30 C12 46 24 46 36 30 S60 14 72 30 S96 46 96 30'/%3E%3Cpath d='M0 22 C16 8 32 8 48 22 S80 36 96 22'/%3E%3Cpath d='M0 38 C16 52 32 52 48 38 S80 24 96 38'/%3E%3C/g%3E%3C/svg%3E");
  --h: 78px; --stub: 186px; --notch: 10px;
  position: absolute; right: var(--gutter); bottom: calc(8vh + 4px); z-index: 4;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-shadow: none; pointer-events: auto;
}
.hxb__card {
  position: relative; display: flex; height: var(--h); color: var(--ink);
  /* the card's shadow: a crisp contact one under a soft one, drawn on a layer of its own so the masks can't cut it */
  filter: drop-shadow(0 1.5px 1.5px rgba(8, 40, 50, .18)) drop-shadow(0 16px 26px rgba(8, 45, 70, .22));
}

/* the pass */
.hxb__pass {
  position: relative; display: flex; align-items: stretch; padding: 0 10px 0 8px; border-radius: 16px 0 0 16px;
  background:
    var(--grain) 0 0 / 180px 180px,
    var(--guilloche) 0 50% / 96px 60px repeat-x,
    linear-gradient(180deg, #FFFEFA 0%, #FFFBF2 60%, #FBF4E6 100%);
  background-blend-mode: multiply, normal, normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -2px 0 rgba(15, 59, 64, .07), inset 0 0 0 1px rgba(15, 59, 64, .05);
  -webkit-mask: radial-gradient(circle var(--notch) at 100% 0, #0000 97%, #000), radial-gradient(circle var(--notch) at 100% 100%, #0000 97%, #000);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle var(--notch) at 100% 0, #0000 97%, #000), radial-gradient(circle var(--notch) at 100% 100%, #0000 97%, #000);
  mask-composite: intersect;
}
.hxb__seg, .hxb__price {
  position: relative; display: grid; align-content: center; gap: 3px; padding: 0 18px; min-width: 0; color: inherit; text-decoration: none;
}
/* a dotted rule between the segments, like the fields on a ticket */
.hxb__seg + .hxb__seg::before, .hxb__price::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px;
  background: repeating-linear-gradient(180deg, rgba(15, 59, 64, .28) 0 2px, transparent 2px 5px);
}
.hxb__seg small, .hxb__price small, .hxb__stub small {
  font: 500 8.5px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; opacity: .55; white-space: nowrap;
}
.hxb__seg b, .hxb__price b { font: 800 21px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.hxb__seg i, .hxb__price i { font: 500 9.5px/1 var(--mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; opacity: .6; white-space: nowrap; }
.hxb__price b { color: var(--accent); }
/* a segment lifts a little under the pointer, and shows it can be changed */
.hxb__seg { transition: background-color .25s ease; border-radius: 10px; }
.hxb__seg::after {
  content: ""; position: absolute; right: 7px; top: 50%; width: 5px; height: 5px; margin-top: -4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .35;
  transition: opacity .25s ease, transform .25s ease;
}
.hxb__seg:hover, .hxb__seg:focus-visible { background-color: rgba(25, 181, 184, .08); outline: none; }
.hxb__seg:hover::after, .hxb__seg:focus-visible::after { opacity: .8; transform: translateY(2px) rotate(45deg); }
.hxb__seg:hover b, .hxb__seg:focus-visible b { color: #0B6E78; }

/* the stub: light water blue, its half of each notch and a punched perforation down its edge */
.hxb__stub {
  --hole: 2.4px; --pitch: 6.5px; --hx: 4px;
  position: relative; display: grid; align-content: center; gap: 7px; width: var(--stub); padding: 0 18px 0 28px;
  border-radius: 0 16px 16px 0; color: var(--ink); text-decoration: none;
  background:
    var(--grain) 0 0 / 180px 180px,
    linear-gradient(105deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .38) 48%, rgba(255, 255, 255, 0) 61%) 0 0 / 300% 100%,
    radial-gradient(130% 160% at 18% 0%, rgba(190, 243, 247, .9) 0%, rgba(190, 243, 247, 0) 62%),
    linear-gradient(180deg, #7FD8E6 0%, #55C2D6 55%, #3AAFC8 100%);
  background-blend-mode: soft-light, normal, normal, normal;
  animation: hxb-sheen 9s ease-in-out infinite alternate;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 0 rgba(10, 80, 100, .12);
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 0, #0000 97%, #000),
    radial-gradient(circle var(--notch) at 0 100%, #0000 97%, #000),
    radial-gradient(circle var(--hole) at var(--hx) 50%, #0000 62%, #000 100%) 0 50% / 10px var(--pitch) repeat-y,
    linear-gradient(#000, #000) 10px 0 / calc(100% - 10px) 100% no-repeat;
  -webkit-mask-composite: source-in, source-in, source-over, source-over;
  mask:
    radial-gradient(circle var(--notch) at 0 0, #0000 97%, #000),
    radial-gradient(circle var(--notch) at 0 100%, #0000 97%, #000),
    radial-gradient(circle var(--hole) at var(--hx) 50%, #0000 62%, #000 100%) 0 50% / 10px var(--pitch) repeat-y,
    linear-gradient(#000, #000) 10px 0 / calc(100% - 10px) 100% no-repeat;
  mask-composite: intersect, intersect, add, add;
}
.hxb__stub small { opacity: .62; }
.hxb__stub b { font: 800 19px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.hxb__stub b span { display: inline-block; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.hxb__stub:hover b span, .hxb__stub:focus-visible b span { transform: translateX(5px); }
.hxb__stub:focus-visible { outline: none; filter: brightness(1.06); }
@keyframes hxb-sheen { from { background-position: 0 0, 100% 0, 0 0, 0 0; } to { background-position: 0 0, 0% 0, 0 0, 0 0; } }

/* the trust line: quiet, on a small frosted chip so it reads over the bright shallows, a sun-yellow row of stars */
.hxb__trust {
  margin: 0 4px 0 0; padding: 6px 12px 6px 10px; border-radius: 99px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); background: rgba(255, 253, 247, .62); -webkit-backdrop-filter: blur(8px) saturate(1.2); backdrop-filter: blur(8px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 4px 14px rgba(8, 45, 70, .1);
}
.hxb__stars { color: #EE9A1E; letter-spacing: .1em; margin-right: 5px; }

@media (prefers-reduced-motion: reduce) { .hxb__stub { animation: none; } }

/* between a small laptop and a big one, the price folds into the island segment to keep clear of the headline */
@media (max-width: 1240px) and (min-width: 761px) {
  .hxb { --h: 72px; --stub: 168px; }
  .hxb__seg, .hxb__price { padding: 0 14px; }
  .hxb__seg b, .hxb__price b { font-size: 19px; }
  .hxb__price { display: none; }
}

/* phone: under the headline, the width of the screen. The headline steps up to make room */
@media (max-width: 760px) {
  html[data-hx="bar"][data-hero="cover"] .hero { padding-bottom: calc(7vh + 92px); }
  .hxb { --h: 60px; --stub: 112px; --notch: 8px; left: 14px; right: 14px; bottom: calc(7vh - 6px); align-items: stretch; gap: 8px; }
  .hxb__card { width: 100%; }
  .hxb__pass { flex: 1; padding: 0 2px 0 4px; min-width: 0; }
  .hxb__seg, .hxb__price { padding: 0 9px; gap: 3px; flex: 1 1 auto; }
  .hxb__seg + .hxb__seg::before, .hxb__price::before { top: 14px; bottom: 14px; }
  .hxb__seg::after { display: none; }
  .hxb__seg small, .hxb__stub small { font-size: 7px; letter-spacing: .16em; }
  .hxb__seg b { font-size: 15px; }
  .hxb__seg i { display: none; }
  .hxb__price { display: none; }
  .hxb__stub { padding: 0 10px 0 20px; gap: 5px; }
  .hxb__stub b { font-size: 14px; gap: 5px; }
  .hxb__trust { font-size: 8px; letter-spacing: .12em; align-self: center; padding: 5px 10px; margin: 0; }
}
