/* SamMcManus.net shared sticky header — Version 3 */

:root {
  --header-ink: #010302;
  --header-panel: #050a08;
  --header-line: #1a2924;
  --header-paper: #f3f4ec;
  --header-lime: #b8ff16;
  --header-cyan: #20e0d0;
}

[data-header-placeholder] *,
[data-header-placeholder] *::before,
[data-header-placeholder] *::after {
  box-sizing: border-box;
}

[data-header-placeholder] a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: relative;
  z-index: 1000;
  top: 0;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 72px);
  border-bottom: 1px solid var(--header-line);
  background: rgba(1, 3, 2, 0.94);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--header-paper);
  letter-spacing: 0.08em;
}

.site-brand b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--header-cyan);
  color: var(--header-cyan);
  font-size: 11px;
}

.site-brand span {
  font-size: 14px;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 100%;
  color: var(--header-paper);
  font-size: 14px;
}

.site-nav a {
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--header-cyan);
}

.site-outline {
  padding: 12px 18px;
  border: 1px solid rgba(184, 255, 22, 0.42);
}

.site-outline:hover,
.site-outline:focus-visible {
  border-color: var(--header-lime);
}

.tools-menu {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.tools-menu summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  height: 100%;
  padding: 0;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}

.tools-menu summary::-webkit-details-marker {
  display: none;
}

.tools-menu summary:hover,
.tools-menu summary:focus-visible,
.tools-menu:hover summary,
.tools-menu:focus-within summary,
.tools-menu[open] summary {
  color: var(--header-cyan);
}

.tools-popover {
  position: absolute;
  top: calc(100% - 1px);
  left: -18px;
  width: 270px;
  padding: 8px;
  border: 1px solid #263a33;
  background: var(--header-panel);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.tools-popover::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 25px; /* 8px */
  width: 52px;
  height: 2px;
  background: var(--header-lime);
}

.tools-menu:hover .tools-popover,
.tools-menu:focus-within .tools-popover,
.tools-menu[open] .tools-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.tool-card {
  display: block;
  padding: 13px 14px;
  border-left: 2px solid transparent;
  color: var(--header-paper);
  font-size: 13px;
  line-height: 1.35;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-left-color: var(--header-lime);
  background: rgba(32, 224, 208, 0.08);
  color: var(--header-cyan);
  outline: none;
}

.tool-card[aria-current="page"] {
  border-left-color: var(--header-lime);
  background: rgba(184, 255, 22, 0.05);
  color: var(--header-lime);
}

.tool-copy {
  display: block;
  font-weight: 700;
}

@media (max-width: 700px) {
  .site-header {
    height: 70px;
    padding: 0 16px;
  }

  .site-brand span {
    font-size: 12px;
  }

  .site-nav {
    gap: 15px;
  }

  .tools-menu {
    height: auto;
  }

  .tools-menu-label {
    display: none;
  }

  .tools-menu summary {
    width: 44px;
    height: 40px;
    justify-content: center;
    border: 1px solid #2f4740;
  }

  .tools-menu summary::before {
    content: "TOOLS";
    color: var(--header-paper);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  .tools-popover {
    position: fixed;
    top: 69px;
    right: 12px;
    left: auto;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 82px);
    overflow-y: auto;
  }

  .site-outline {
    padding: 10px 12px;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .site-brand span {
    display: none;
  }

  .site-nav {
    gap: 10px;
  }

  .site-outline {
    padding: 9px 10px;
    font-size: 12px;
  }
}
