/*
  topnav.css — global hex button navigation
  Renders a strip of 10 hexagonal buttons at the top of every segment.
*/

.topnav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.65rem clamp(0.75rem, 2vw, 1.5rem);
  background: rgba(10, 11, 18, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topnav__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: var(--content-wide);
  margin: 0 auto;
}

/* Grid: 5 hex + home + 5 hex. 11 equal cells. Home in visual center. */
.topnav__buttons {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 0.4rem;
  width: 100%;
  align-items: center;
  justify-items: center;
}

.topnav__home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  text-decoration: none;
  border: 0;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: color 0.2s var(--easing), transform 0.25s var(--easing);
  position: relative;
}

.topnav__home:hover { color: var(--text); transform: translateY(-2px); }
.topnav__home:hover .topnav__home-label { color: var(--text); }

.topnav__home svg { width: 22px; height: 22px; }

.topnav__home-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.topnav__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  border: 0;
  padding: 2px;
  cursor: pointer;
  background: transparent;
  position: relative;
  color: var(--accent);
  transition: transform 0.25s var(--easing), color 0.25s var(--easing);
}

.topnav__btn:hover, .topnav__btn:focus-visible {
  transform: translateY(-2px);
  color: var(--text);
  outline: none;
}

.topnav__hex {
  width: 40px;
  height: 36px;
  display: block;
}

.topnav__hex-bg {
  fill: rgba(20, 21, 42, 0.6);
  stroke: var(--accent);
  stroke-width: 1.2;
  transition: all 0.25s var(--easing);
}

.topnav__btn:hover .topnav__hex-bg,
.topnav__btn:focus-visible .topnav__hex-bg {
  fill: var(--accent-soft);
  stroke-width: 1.6;
}

.topnav__btn.is-current .topnav__hex-bg {
  fill: var(--accent);
  stroke: var(--accent);
}

.topnav__btn.is-current .topnav__icon {
  color: #0A0B12;
}

.topnav__btn.is-current {
  cursor: default;
}

.topnav__icon {
  color: var(--accent);
  transition: color 0.25s var(--easing);
}

.topnav__btn:hover .topnav__icon { color: var(--accent); }

.topnav__btn.is-coming .topnav__hex-bg {
  stroke-dasharray: 3 2;
  stroke: rgba(201, 169, 97, 0.55);
}

.topnav__btn.is-coming .topnav__icon { opacity: 0.55; }

.topnav__label {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topnav__btn:hover .topnav__label,
.topnav__btn:focus-visible .topnav__label,
.topnav__btn.is-current .topnav__label {
  color: var(--text);
}

.topnav__coming {
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 880px) {
  .topnav { padding: 0.5rem 0.5rem; }
  .topnav__inner { gap: 0.2rem; }
  .topnav__home { padding: 0.2rem 0.3rem; margin-right: 0.2rem; }
  .topnav__home-label { display: none; }
  .topnav__hex { width: 34px; height: 30px; }
  .topnav__label { display: none; }
}

@media (max-width: 480px) {
  .topnav__hex { width: 28px; height: 25px; }
}
