/* ==========================================================================
   HEADER.CSS — AAA LED site header
   Onyx bar with a warm amber diode accent. The signature move: the strip
   under the header isn't a static dashed rule, it's an actual chasing
   LED dot-matrix, like a programmable sign scrolling — literal to the
   product. Logo sits in a paper-toned tile so a plain jpeg logo doesn't
   look stranded on the dark background.
   Self-contained: does not depend on style.css variables.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@500;600;700&display=swap');

:root {
  --hdr-bg: #0d1117;
  --hdr-bg-elevated: #161b22;
  --hdr-border: #242b38;
  --hdr-text: #f4f6f9;
  --hdr-text-muted: #8b94a6;
  --hdr-accent: #ffb020;
  --hdr-accent-2: #ff7a45;
  --hdr-accent-dim: rgba(255, 176, 32, 0.14);
  --hdr-glow: rgba(255, 176, 32, 0.35);
  --hdr-logo-tile: #f7f4ea;
  --hdr-font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --hdr-font-body: 'Inter', 'Segoe UI', sans-serif;
}

/* --------------------------------------------------------------------------
   HEADER SHELL
   The bar carries a faint LED matrix texture (a repeating dot grid, like
   the physical surface of a panel) and bleeds a soft amber glow onto the
   page below it — light spilling off a sign at night.
   -------------------------------------------------------------------------- */
.site-header {
  background:
    radial-gradient(circle, rgba(255, 176, 32, 0.055) 1px, transparent 1.4px) 0 0 / 14px 14px,
    var(--hdr-bg);
  font-family: var(--hdr-font-body);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 10px 26px -14px var(--hdr-glow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* --------------------------------------------------------------------------
   SIGNATURE STRIP — chasing LED dot-matrix under the header
   A row of dim diodes with a bright amber pulse that sweeps left to
   right on loop, echoing an actual programmable LED sign. Reduced to a
   static amber row for anyone who prefers less motion.
   -------------------------------------------------------------------------- */
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background-image:
    radial-gradient(circle, var(--hdr-border) 1px, transparent 1.4px),
    linear-gradient(
      90deg,
      transparent 0%,
      transparent 40%,
      var(--hdr-accent) 47%,
      var(--hdr-accent-2) 50%,
      var(--hdr-accent) 53%,
      transparent 60%,
      transparent 100%
    );
  background-size: 8px 3px, 260px 3px;
  background-repeat: repeat-x, no-repeat;
  background-position: 0 0, -260px 0;
  filter: drop-shadow(0 0 4px var(--hdr-glow));
  animation: chase 4s linear infinite;
}

@keyframes chase {
  0%   { background-position: 0 0, -260px 0; }
  100% { background-position: 0 0, calc(100% + 260px) 0; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header::after {
    animation: none;
    background-image:
      radial-gradient(circle, var(--hdr-border) 1px, transparent 1.4px),
      radial-gradient(circle, var(--hdr-accent) 1px, transparent 1.4px);
    background-size: 8px 3px, 8px 3px;
    background-position: 0 0, 0 0;
    opacity: 0.9;
  }
}

/* --------------------------------------------------------------------------
   BRAND / LOGO
   -------------------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--hdr-text);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 9px;
  background: var(--hdr-logo-tile);
  padding: 5px;
  border: 1px solid var(--hdr-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.brand:hover .brand-logo {
  border-color: var(--hdr-accent);
  box-shadow: 0 0 0 3px var(--hdr-accent-dim);
  transform: translateY(-1px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand span {
  font-family: var(--hdr-font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  text-shadow: 0 0 12px rgba(255, 176, 32, 0);
  animation: power-on 1.4s ease-out both;
}

/* on load, the wordmark "powers on" like a sign booting up — flickers
   twice then settles into a steady glow. One orchestrated moment
   rather than motion scattered everywhere. */
@keyframes power-on {
  0%   { opacity: 0.2; text-shadow: 0 0 0 rgba(255, 176, 32, 0); }
  8%   { opacity: 1;   text-shadow: 0 0 14px rgba(255, 176, 32, 0.6); }
  18%  { opacity: 0.3; text-shadow: 0 0 0 rgba(255, 176, 32, 0); }
  26%  { opacity: 1;   text-shadow: 0 0 14px rgba(255, 176, 32, 0.6); }
  40%  { opacity: 0.6; }
  60%  { opacity: 1;   text-shadow: 0 0 4px rgba(255, 176, 32, 0.25); }
  100% { opacity: 1;   text-shadow: 0 0 4px rgba(255, 176, 32, 0.25); }
}

/* the diode: a live indicator light, breathing gently rather than static */
.brand span::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--hdr-accent);
  box-shadow: 0 0 6px 1px var(--hdr-accent);
  animation: breathe 2.6s ease-in-out infinite 1.4s;
}

@keyframes breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 7px 1.5px var(--hdr-accent); }
  50%      { opacity: 0.5; box-shadow: 0 0 3px 0.5px var(--hdr-accent); }
}

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

.brand-tagline {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--hdr-text-muted);
  text-transform: none;
}

/* --------------------------------------------------------------------------
   MOBILE TOGGLE
   -------------------------------------------------------------------------- */
.menu-toggle {
  display: none;
  border: 1px solid var(--hdr-border);
  background: var(--hdr-bg-elevated);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.menu-toggle:hover {
  border-color: var(--hdr-accent);
  background: var(--hdr-accent-dim);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--hdr-text);
  margin: 4px 0;
  border-radius: 2px;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle:hover span {
  background: var(--hdr-accent);
}

/* toggle → X when menu is open (add .is-open via JS on the button) */
.menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   DESKTOP NAV
   -------------------------------------------------------------------------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  color: var(--hdr-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

/* a thin light scans across the pill on hover, like a panel refreshing */
.main-nav a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 176, 32, 0.22) 50%,
    transparent 80%
  );
  transform: translateX(-120%);
  transition: none;
}

.main-nav a:hover::after {
  animation: scan 0.7s ease;
}

@keyframes scan {
  to { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav a:hover::after { animation: none; }
}

.main-nav a::before {
  content: "";
  width: 0;
  height: 6px;
  border-radius: 50%;
  background: var(--hdr-accent);
  box-shadow: 0 0 6px 1px var(--hdr-accent);
  margin-right: 0;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease, margin-right 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.active {
  color: var(--hdr-text);
  background: var(--hdr-accent-dim);
}

.main-nav a:hover::before,
.main-nav a:focus-visible::before,
.main-nav a.active::before {
  width: 6px;
  opacity: 1;
  margin-right: 7px;
}

.main-nav a:focus-visible {
  outline: 2px solid var(--hdr-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   MOBILE SLIDE-OUT MENU + BACKDROP
   -------------------------------------------------------------------------- */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 290;
}

.mobile-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: var(--hdr-bg);
  border-right: 1px solid var(--hdr-border);
  padding: 1.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: left 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 300;
  font-family: var(--hdr-font-body);
}

.mobile-menu.open {
  left: 0;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--hdr-border);
  font-family: var(--hdr-font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--hdr-accent);
}

.menu-close {
  border: 1px solid var(--hdr-border);
  background: var(--hdr-bg-elevated);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--hdr-text);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.menu-close:hover {
  color: var(--hdr-accent);
  border-color: var(--hdr-accent);
}

.mobile-menu a {
  position: relative;
  display: block;
  color: var(--hdr-text);
  text-decoration: none;
  padding: 0.85rem 0 0.85rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--hdr-border);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-menu a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hdr-accent);
  box-shadow: 0 0 5px 1px var(--hdr-accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--hdr-accent);
  padding-left: 1.2rem;
  background: var(--hdr-accent-dim);
}

.mobile-menu a:hover::before,
.mobile-menu a.active::before {
  opacity: 1;
}

/* touch devices don't reliably fire :hover — give taps their own
   instant feedback so the menu never feels unresponsive on mobile */
.mobile-menu a:active {
  background: var(--hdr-accent-dim);
  color: var(--hdr-accent);
}

.main-nav a:active,
.menu-toggle:active,
.menu-close:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .menu-toggle {
    display: inline-block;
  }

  .main-nav {
    display: none;
  }

  .brand-tagline {
    display: none;
  }
}