/* Mobile drawer styling. Additive layer, everything namespaced .gl-dr*.
   Tokens reused from the site: --void, --bone, --ash, --violet, --hairline. */

/* Hamburger lives in the top bar, phones only. */
.gl-dr-btn { display: none; }

@media (max-width: 760px) {
  .gl-dr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-right: 2px;
    flex: 0 0 auto;
    border: 1px solid var(--hairline, rgba(255, 255, 255, .12));
    border-radius: 10px;
    background: transparent;
    color: var(--bone, #f0f0f0);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .gl-dr-btn svg { width: 20px; height: 20px; }
  .gl-dr-btn:active { background: rgba(255, 255, 255, .06); }
}

/* Backdrop */
.gl-dr-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .6);
  opacity: 0;
  transition: opacity .22s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.gl-dr-open .gl-dr-backdrop { opacity: 1; }

/* Panel */
.gl-dr {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 95;
  width: min(78vw, 288px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(#0a0a0b, #000);
  border-right: 1px solid var(--hairline, rgba(255, 255, 255, .12));
  /* Off-canvas by default; translate keeps it out of the layout entirely
     rather than relying on visibility, so it never steals a tap. */
  transform: translateX(-102%);
  transition: transform .24s cubic-bezier(.22, .8, .3, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.gl-dr:focus { outline: none; }
.gl-dr-open .gl-dr { transform: translateX(0); }

/* Hide from desktop entirely: the icon rail is back at >760px. */
@media (min-width: 761px) {
  .gl-dr,
  .gl-dr-backdrop { display: none !important; }
}

/* Header */
.gl-dr-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--hairline, rgba(255, 255, 255, .1));
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.gl-dr-head img { width: 30px; height: auto; display: block; }

.gl-dr-head span {
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--bone, #f0f0f0);
}

.gl-dr-x {
  margin-left: auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ash, #a1a4a5);
  cursor: pointer;
}

.gl-dr-x svg { width: 18px; height: 18px; }
.gl-dr-x:active { background: rgba(255, 255, 255, .06); }

/* Sections */
.gl-dr-list { padding: 10px 10px 20px; }

.gl-dr-i {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 46px keeps every row above the 44px touch-target floor. */
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ash, #a1a4a5);
  text-decoration: none;
  font-size: 15px;
}

.gl-dr-ic {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.gl-dr-ic svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gl-dr-i:active { background: rgba(255, 255, 255, .05); }

.gl-dr-i.on {
  background: rgba(146, 129, 247, .14);
  color: var(--violet-glow, #9281f7);
}

/* Lock the page behind the drawer. */
.gl-dr-open body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .gl-dr,
  .gl-dr-backdrop { transition: none; }
}
