/* Workouti site navigation - shared by every page.
   One source of truth: markup is identical on all pages, nav.js sets
   aria-current and owns every open/close behaviour. The index hero variant
   is .site-nav.on-hero (absolute over the hero, transparent). The sticky
   context bar (index, z-index 800) appears only after scroll, and this nav
   lives only at the top of the page at z-index 700, so they never fight. */

.site-nav {
  position: relative;
  z-index: 700;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}

.site-nav.on-hero {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-nav-in {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* wordmark */
.sn-brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: var(--text);
  text-decoration: none;
  padding: 17px 0;
  white-space: nowrap;
}
.sn-brand .sn-dot { color: var(--volt); }
.sn-brand:hover .sn-dot { color: var(--text); }

/* desktop link row */
.sn-links {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.6vw, 18px);
}

.sn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 12px 10px;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 3px;
}
.sn-link:hover { color: var(--text); }
.sn-link[aria-current="page"],
.sn-drop-btn.sn-here {
  color: var(--volt);
}
.sn-link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

/* the one CTA */
.sn-cta {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--volt);
  text-decoration: none;
  padding: 12px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  white-space: nowrap;
}
.sn-cta:hover { background: var(--volt-deep); }
/* the generator page is the CTA's destination, so it never advertises itself */
.site-nav.on-hero .sn-cta { display: none; }

/* Tools disclosure (desktop) */
.sn-drop { position: relative; }
.sn-caret {
  width: 8px; height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s;
}
.sn-drop-btn[aria-expanded="true"] .sn-caret { transform: rotate(225deg) translateY(-1px); }

.sn-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 300px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  padding: 8px;
  display: grid;
}
.sn-menu[hidden] { display: none; }

.sn-item {
  display: block;
  padding: 10px 12px;
  border-radius: 3px;
  text-decoration: none;
}
.sn-item:hover, .sn-item:focus-visible { background: var(--surface-2); }
.sn-item-name {
  display: block;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.sn-item[aria-current="page"] .sn-item-name { color: var(--volt); }
.sn-item-desc {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 2px;
}

/* burger */
.sn-burger {
  display: none;
  background: none;
  border: 1px solid var(--ctrl-line, rgba(255, 255, 255, 0.35));
  border-radius: 3px;
  width: 44px; height: 44px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.sn-burger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  transition: transform 0.18s, opacity 0.18s;
}
.sn-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sn-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.sn-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile panel */
.sn-mobile {
  position: fixed;
  inset: 0;
  z-index: 900; /* above the ctxbar: while the menu is open it owns the screen */
  background: rgba(7, 9, 7, 0.97);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 0 20px 32px;
}
.sn-mobile[hidden] { display: none; }

.sn-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.sn-mobile a.sn-m-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 6px;
  min-height: 48px;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.sn-mobile a.sn-m-link:hover { color: var(--volt); }
.sn-mobile a.sn-m-link[aria-current="page"] { color: var(--volt); }
.sn-m-desc {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  text-align: right;
  flex-shrink: 0;
}
.sn-m-group {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 22px 6px 6px;
}
.sn-m-legal {
  display: flex;
  gap: 18px;
  padding: 18px 6px 0;
}
.sn-m-legal a {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 0;
}
.sn-m-legal a:hover { color: var(--text); }

/* focus is always visible, on the same volt line the site uses elsewhere */
.site-nav a:focus-visible,
.site-nav button:focus-visible,
.sn-mobile a:focus-visible,
.sn-mobile button:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 2px;
  border-radius: 3px;
}

/* the close button always draws as an X */
.sn-m-close span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sn-m-close span:nth-child(2) { opacity: 0; }
.sn-m-close span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* body lock while the mobile panel is open */
.sn-locked { overflow: hidden; }

@media print {
  .site-nav, .sn-mobile { display: none !important; }
}

@media (max-width: 760px) {
  .sn-links { display: none; }
  .sn-burger { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  .sn-caret, .sn-burger span { transition: none; }
}
