/*
 * ============================================================
 * hero-band.css — the "service wall" band under the hero
 * ============================================================
 *
 * WHAT THIS FILE DOES:
 *   Styles the wide panel that shows the services included with
 *   Sovran_SystemsOS (Bitcoin Core, LND, Nextcloud, Tor, …).
 *
 * EDITING TIPS (no CSS knowledge required):
 *   - The list of services is NOT here. Edit content.js → hero → band → items.
 *   - To turn the band off entirely, set enabled: false in content.js.
 *   - To make the tiles bigger/smaller, change the minmax() value in .hw-grid.
 *   - Colours come from base.css variables, so they follow the site theme.
 *
 * DEPENDENCIES:
 *   - styles/base.css (colour variables)
 *   - Rendered by app.js (buildHeroBand function)
 * ============================================================
 */

/* ── Shell ────────────────────────────────────────────────── */
.hw {
  position: relative;
  width: 100%;
  padding: clamp(16px, 2.2vw, 26px);
  border-radius: clamp(18px, 2vw, 24px);
  background:
    radial-gradient(120% 160% at 50% -20%, rgba(40, 217, 120, 0.10), transparent 62%),
    linear-gradient(180deg, var(--bg-elevated) 0%, #070a09 100%);
  border: 1px solid var(--border-strong);
  box-shadow:
    0 40px 110px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow: hidden;
  isolation: isolate;
}

/* thin light along the top edge */
.hw::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(66, 243, 154, 0.7), transparent);
  pointer-events: none;
}

.hw-glow {
  position: absolute;
  inset: -40% 20% auto 20%;
  height: 240px;
  background: radial-gradient(closest-side, rgba(40, 217, 120, 0.18), transparent);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

/* ── Top bar ──────────────────────────────────────────────── */
.hw-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: clamp(12px, 1.6vw, 18px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.hw-logo {
  width: clamp(24px, 2.4vw, 30px);
  height: auto;
  border-radius: 8px;
  flex: none;
}

.hw-bar-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hw-bar-text b {
  font-size: clamp(12px, 1.35vw, 15px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hw-bar-text i {
  font-size: clamp(9.5px, 1.05vw, 11.5px);
  font-weight: 600;
  font-style: normal;
  color: var(--muted);
}

.hw-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: clamp(9.5px, 1.05vw, 11px);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--accent-strong);
  background: rgba(40, 217, 120, 0.09);
  border: 1px solid rgba(66, 243, 154, 0.26);
  white-space: nowrap;
}

.hw-count {
  font-size: clamp(9.5px, 1.05vw, 11px);
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Icon grid ────────────────────────────────────────────────
   auto-fit + minmax means the grid REFLOWS as the list grows:
   more services wrap onto new rows instead of being cropped. */
.hw-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(132px, 13.5vw, 158px), 1fr));
  gap: clamp(6px, 0.8vw, 10px);
  padding: clamp(12px, 1.8vw, 20px) 0;
}

.hw-tile {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.7vw, 8px);
  padding: clamp(7px, 0.9vw, 10px) clamp(8px, 1vw, 11px);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--border);
  min-width: 0;
  transition: border-color 160ms ease, background 160ms ease;
}

.hw-tile:hover {
  border-color: rgba(66, 243, 154, 0.22);
  background: linear-gradient(180deg, rgba(40, 217, 120, 0.07), rgba(255, 255, 255, 0.012));
}

.hw-tile-ic {
  width: clamp(16px, 1.8vw, 20px);
  height: clamp(16px, 1.8vw, 20px);
  flex: none;
  display: grid;
  place-items: center;
}

.hw-tile-ic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hw-tile-name {
  font-size: clamp(9.5px, 1.05vw, 11.5px);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-tile-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
  margin-left: auto;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
}

/* a service that is installed but not running yet */
.hw-tile.is-soon {
  opacity: 0.55;
}

.hw-tile.is-soon .hw-tile-dot {
  background: var(--muted);
  box-shadow: none;
}

/* ── Footer strip ─────────────────────────────────────────── */
.hw-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: clamp(11px, 1.5vw, 16px);
  border-top: 1px solid var(--border);
  font-size: clamp(9.5px, 1.05vw, 11.5px);
  font-weight: 700;
  color: var(--muted);
}

.hw-foot svg {
  width: clamp(11px, 1.2vw, 13px);
  height: clamp(11px, 1.2vw, 13px);
  flex: none;
  color: var(--accent);
}

.hw-foot em {
  margin-left: auto;
  font-style: normal;
  color: var(--accent-strong);
}

/* ── Status dot ───────────────────────────────────────────── */
.hw-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: hw-pulse 2s ease-in-out infinite;
}

@keyframes hw-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  .hw-dot { animation: none; }
  .hw-tile { transition: none; }
}

/* ── Small screens ────────────────────────────────────────────
   Two tiles per row on phones so names are never truncated. */
@media (max-width: 640px) {
  .hw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .hw-tile {
    padding: 7px 8px;
  }
  .hw-tile-name {
    font-size: 10px;
  }
  .hw-count {
    display: none;
  }
  .hw-foot span {
    white-space: normal;
  }
}

@media (max-width: 380px) {
  .hw-tile-name {
    font-size: 9.5px;
  }
  .hw-badge {
    display: none;
  }
}
