/* bar.css, the bottom bar. Tested behind ?bar=1 from 2026-09-25, live on
   every page since 2026-09-28.

   Copied from tryhappyads.com, Sabby's older Webflow site, off its computed
   styles measured in a real browser at 390 and 1440 wide, not guessed from a
   screenshot. His words: the bar at the bottom looks beautiful, make that
   exact bar. Two differences, both on purpose:

   1. Poppins, not Happy Ads' Space Grotesk. The site's type is the brand.
   2. It stays hidden until the first screen has scrolled away. Happy Ads
      shows it from the start; Sabby wants the hero left alone.

   Happy Ads numbers kept as measured: fixed 20px off the bottom, 1px
   #555B62 outline, 20px corners, rgba(26,29,34,.9) with a 5px blur, padding
   10 10 10 16, a 35px home icon, a 32px burger of three 16x2 lines, links at
   16px/600 in #EDEDED with 12px 16px padding and 12px corners, and the Apply
   button 40px tall, 12px corners, 12px 20px padding, white on the accent.
   The links live in the burger's panel above the bar on every screen size.

   One change since, 2026-09-28: on the black site the Happy Ads blue-grey
   glass read as matte, a grey slab on a black page. So the bar and its panel
   take the homepage boxes' look instead (the What we hear columns and the
   job cards: near-black, a faint light edge), with the edge a step brighter
   than the boxes' .12 so it holds its shape floating over text. Four other
   colours were tried the same evening (dark teal, frosted glass, black with
   a teal edge, white); Sabby kept this one.

   Everything is scoped to .dbar. */

.dbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;            /* only the bar itself takes taps */
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, .8, .2, 1);
  font-family: 'Poppins', sans-serif;
}
.dbar.is-shown { opacity: 1; transform: none; }

.dbar-inner {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 64px;
  padding: 10px 10px 10px 16px;
  border: 1px solid rgba(232, 232, 232, .16);
  border-radius: 20px;
  background: rgba(10, 10, 10, .92);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
}
.dbar:not(.is-shown) .dbar-inner { pointer-events: none; }

.dbar-left { display: flex; align-items: center; gap: 10px; }

.dbar-home {
  display: block;
  width: 35px;
  height: 35px;
  color: #EDEDED;
  -webkit-tap-highlight-color: transparent;
}
.dbar-home svg { display: block; width: 35px; height: 35px; }
.dbar-home:hover { color: #fff; }

/* The burger. Three lines become an X when the panel is open, the same as
   Happy Ads. A <button>, so it is reachable by keyboard and says what it
   does to a screen reader. */
.dbar-menu {
  display: flex;
  width: 32px;
  height: 32px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.dbar-menu span {
  display: block;
  width: 16px;
  height: 2px;
  background: #EDEDED;
  border-radius: 1px;
  transition: transform .25s ease, opacity .2s ease;
}
.dbar.is-open .dbar-menu span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.dbar.is-open .dbar-menu span:nth-child(2) { opacity: 0; }
.dbar.is-open .dbar-menu span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.dbar-apply {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, .1);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color .2s ease;
}
.dbar-apply:hover { color: #fff; background: var(--accent-deep); }

/* The panel the burger opens. Same glass as the bar, 8px above it. */
.dbar-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 20px 16px;
  border: 1px solid rgba(232, 232, 232, .16);
  border-radius: 20px;
  /* Near-solid, unlike the bar: the page's text showed through the links. */
  background: rgba(10, 10, 10, .98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.dbar.is-open .dbar-panel { opacity: 1; transform: none; pointer-events: auto; }
.dbar-panel a {
  display: block;
  padding: 10px 0;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.dbar-panel a + a { margin-top: 12px; }

/* Room under the footer so the bar never sits on the wolves at the end. */
html footer { padding-bottom: 110px; }

/* One size on every screen since 2026-09-28, the phone's: Sabby wanted the
   desktop bar to be home, menu and Apply now, with the links in the panel.
   74vw closed is Happy Ads' own value, capped at 340px; it widens when the
   panel opens, the way theirs does, so the panel has room. */
.dbar-inner { width: 74vw; max-width: 340px; height: 62px; transition: width .3s ease, max-width .3s ease; }
.dbar.is-open .dbar-inner { width: calc(100vw - 20px); max-width: 520px; }
@media (max-width: 360px) {
  .dbar-inner { width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .dbar, .dbar-inner, .dbar-panel, .dbar-menu span { transition: none; }
}

/* A safety net, 2026-09-28. Until today bar.js also built a row of inline
   links (.dbar-links) for wide screens. A phone holding yesterday's bar.js
   in its cache next to today's bar.css showed them as loose text across the
   bar. The pages now load both files with ?v= so they update together, and
   this keeps an old copy harmless if one ever slips through. Bump the ?v= in
   all four pages whenever bar.js or bar.css changes. */
.dbar-links { display: none; }

