/* Hotbar: a floating liquid-glass bar along the top of the page, with pixel corners.
   Says what the program is (a card that drops down), who runs it, how to reach us,
   and where to follow along. hotbar.js opens and closes the card.
   One unit is 2px: the corners, frame, slots and shadow are all whole units. */
.hotbar {
  --hb-corners: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px),
    calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px),
    0 4px, 2px 4px, 2px 2px, 4px 2px);
  --hb-ink: #ffffff;
  --hb-muted: rgba(230, 232, 251, 0.72);
  --hb-gold: #ffcf78;
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 150;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  animation: hb-bob 3.2s steps(3, jump-none) infinite alternate;
}

/* pixel drop shadow, two units below the glass */
.hotbar::before,
.hb-card::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateY(4px);
  background: rgba(5, 8, 25, 0.35);
  clip-path: var(--hb-corners);
  pointer-events: none;
}

.hb-glass {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  color: var(--hb-ink);
  text-shadow: 0 1px 0 rgba(5, 8, 25, 0.6);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06) 55%, rgba(255, 255, 255, 0.1));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  clip-path: var(--hb-corners);
}

/* the pixel frame: a 9×9 drawing stretched along the edges, 2px per pixel,
   with a brighter row under the top edge for the glass highlight */
.hb-glass::after,
.hb-card-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 6px solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' fill-opacity='.5' d='M2 0h5v1H2zM1 1h1v1H1zM7 1h1v1H7zM0 2h1v5H0zM8 2h1v5H8zM1 7h1v1H1zM7 7h1v1H7zM2 8h5v1H2z'/%3E%3Cpath fill='%23fff' fill-opacity='.28' d='M2 1h5v1H2z'/%3E%3C/svg%3E") 3 / 6px stretch;
  pointer-events: none;
}

/* ── who runs it ── */
.hb-org {
  display: grid;
  gap: 4px;
  padding: 2px 4px 2px 0;
  color: inherit;
  text-decoration: none;
}

.hb-kicker,
.hb-follow {
  font: 400 9px/1 'Silkscreen', ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hb-muted);
  white-space: nowrap;
}

.hb-name {
  font: 600 15px/1.15 'Pixelify Sans', 'Silkscreen', ui-monospace, monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hb-br {
  display: none;
}

.hb-out {
  width: 10px;
  height: 10px;
  margin-left: 6px;
  fill: currentColor;
  shape-rendering: crispEdges;
  transition: transform 0.15s steps(2);
}

.hb-org:hover .hb-name {
  color: #fff0c2;
}

.hb-org:hover .hb-out {
  transform: translate(2px, -2px);
}

.hb-org:focus-visible {
  outline: 2px solid var(--hb-gold);
  outline-offset: 2px;
}

/* ── dotted pixel divider ── */
.hb-sep {
  flex: none;
  width: 2px;
  height: 26px;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0 2px, transparent 2px 4px);
}

/* ── slots: square keys like a game hotbar; the About slot also has a label on wide screens ── */
.hb-slot {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  color: var(--hb-ink);
  text-decoration: none;
  background: rgba(5, 8, 25, 0.25);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px),
    calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px);
  transition: background 0.15s steps(2), box-shadow 0.15s steps(2);
}

.hb-slot svg {
  flex: none;
  width: 22px;
  height: auto;
  fill: currentColor;
  shape-rendering: crispEdges;
  filter: drop-shadow(0 1px 0 rgba(5, 8, 25, 0.6));
}

/* the selected-slot look: a bright frame */
.hb-slot:hover,
.hb-slot[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.hb-slot:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 2px var(--hb-gold);
}

button.hb-slot {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.hb-text {
  font: 500 14px/1 'Pixelify Sans', 'Silkscreen', ui-monospace, monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hb-slot .hb-caret {
  width: 10px;
  margin-left: -2px;
  transition: transform 0.15s steps(2);
}

.hb-slot[aria-expanded="true"] .hb-caret {
  transform: rotate(180deg);
}

/* ── the About card: drops down under the bar ── */
.hb-card {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  width: min(440px, calc(100vw - 32px));
  transform: translateX(-50%);
  animation: hb-drop 0.2s steps(3) both;
}

.hb-card[hidden] {
  display: none;
}

.hb-card-glass {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 18px 20px 20px;
  color: var(--hb-ink);
  text-shadow: 0 1px 0 rgba(5, 8, 25, 0.6);
  background: linear-gradient(180deg, rgba(28, 34, 84, 0.7), rgba(10, 14, 42, 0.82));
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  clip-path: var(--hb-corners);
}

.hb-card-glass p {
  margin: 0;
}

.hb-card-text {
  font: 400 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hb-card-meta {
  font: 400 13px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--hb-muted);
}

.hb-card-more {
  justify-self: start;
  margin-top: 2px;
  font: 400 11px/1 'Silkscreen', ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hb-gold);
  text-decoration: none;
}

.hb-card-more:hover {
  color: #fff0c2;
}

.hb-card-more:focus-visible {
  outline: 2px solid var(--hb-gold);
  outline-offset: 3px;
}

.hb-arrows {
  display: inline-block;
  transition: transform 0.15s steps(2);
}

.hb-card-more:hover .hb-arrows {
  transform: translateX(3px);
}

.hb-card-fine {
  padding-top: 8px;
  border-top: 2px dotted rgba(255, 255, 255, 0.18);
  font: 400 11px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: rgba(230, 232, 251, 0.55);
}

.hb-follow {
  margin-right: -2px;
}

@keyframes hb-bob {
  from { transform: translateX(-50%) translateY(0); }
  to   { transform: translateX(-50%) translateY(-4px); }
}

@keyframes hb-drop {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hotbar,
  .hb-card {
    animation: none;
  }
}

/* ── narrower screens: the About slot becomes a "?" key ── */
@media (max-width: 760px) {
  .hb-text,
  .hb-slot .hb-caret {
    display: none;
  }
}

/* ── phones: the name wraps onto two lines and the bar tightens ── */
@media (max-width: 560px) {
  .hotbar {
    top: calc(10px + env(safe-area-inset-top, 0px));
  }

  .hb-glass {
    gap: 6px;
    padding: 6px 8px 6px 12px;
  }

  .hb-name {
    font-size: 13px;
  }

  .hb-br {
    display: inline;
  }

  .hb-follow {
    display: none;
  }

  .hb-slot {
    min-width: 36px;
    height: 36px;
  }
}

/* ── the smallest phones: tighter still, one divider, the four keys side by side ── */
@media (max-width: 360px) {
  .hb-glass {
    gap: 4px;
    padding-right: 6px;
  }

  .hb-name {
    font-size: 12px;
  }

  .hb-out,
  .hb-sep ~ .hb-sep {
    display: none;
  }

  .hb-slot {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
  }

  .hb-slot svg {
    width: 18px;
  }
}
