
:root { --nav-h: 58px; }

/* Disable the browser's double-tap-to-zoom gesture site-wide, so rapid taps on buttons or the
   bottom nav never accidentally zoom the page. Pinch-to-zoom and scrolling are preserved. */
* { touch-action: manipulation; }

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: #141416;                 /* deep violet-black bar */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: env(safe-area-inset-top); /* fill behind the status bar */
}
.site-nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6vw;
}
.site-nav__logo {
  display: inline-flex;
  -webkit-tap-highlight-color: transparent;
}
.site-nav__logo img {
  height: 34px;
  width: auto;
  display: block;
}
.site-nav__search {
  flex: 1;
  min-width: 0;
  max-width: 560px;
  margin-left: 24px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: text;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;          /* no double-tap-to-zoom on the search */
  transition: background 0.3s cubic-bezier(0.32, 0.72, 0, 1),
              border-color 0.3s cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.site-nav__search:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}
.site-nav__search:focus-within {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.site-nav__search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: system-ui, sans-serif;
  /* 16px keeps iOS Safari from auto-zooming the page on focus */
  font-size: 16px;
  letter-spacing: 0.01em;
  padding: 0;
  touch-action: manipulation;          /* no double-tap-to-zoom on the input */
}
.site-nav__search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
/* Hide the native search clear/decoration so it reads as our own field */
.site-nav__search-input::-webkit-search-decoration,
.site-nav__search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.site-nav__search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.3s ease;
}
.site-nav__search:focus-within .site-nav__search-icon { color: rgba(255, 255, 255, 0.75); }

/* Desktop: centre the search bar in the viewport with equal space on both sides
   (logo left · search centred · equal right gutter) via a 1fr auto 1fr grid. */
@media (min-width: 701px) {
  .site-nav__inner {
    display: grid;
    grid-template-columns: 1fr minmax(0, 560px) 1fr;
    gap: 0;
  }
  .site-nav__logo { justify-self: start; }
  .site-nav__search {
    grid-column: 2;
    justify-self: stretch;
    width: 100%;
    max-width: 560px;
    margin-left: 0;
  }
  /* Connect Discord / account button sits in the right column at its natural
     width (grid would otherwise stretch it across the whole 1fr column). */
  .site-nav__inner > .acct-nav-btn { grid-column: 3; justify-self: end; width: auto; }
}

@media (max-width: 700px) {
  :root { --nav-h: 52px; }
  .site-nav__inner { padding: 0 20px; }
  .site-nav__logo img { height: 30px; }
  .site-nav__search { margin-left: 16px; max-width: none; height: 38px; }
}
