/* Mobile drawer UX — float, slide-in, account card, no external arrows, header pad */

@keyframes udh-drawer-slide-in {
  from {
    transform: translateX(calc(-100% - 1.25rem));
    opacity: 0.92;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes udh-drawer-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(calc(-100% - 1.25rem));
    opacity: 0.92;
  }
}

@keyframes udh-scrim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes udh-scrim-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (max-width: 52rem) {
  body.site-nav-mobile-open .site-mobile-overlay,
  body.site-nav-mobile-open .site-mobile-overlay.open,
  .site-mobile-overlay.open {
    z-index: 10250 !important;
  }

  body.site-nav-mobile-open #app-header.site-header,
  body.site-nav-mobile-open #app-header {
    z-index: 10050 !important;
  }

  #app-header.site-header,
  #app-header {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  #app-header .site-header-inner,
  #app-header .site-header-inner--composable {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    box-sizing: border-box !important;
  }

  #app-header .udh-actions {
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 0.45rem !important;
  }

  #app-header .site-nav-mobile--toolbar {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #app-header .layout-item:has(.site-nav-mobile--toolbar) {
    flex: 0 0 auto !important;
    width: auto !important;
  }

  #app-header .layout-item[data-id="account"] {
    margin-left: 0 !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open {
    position: fixed !important;
    inset: auto !important;
    top: max(0.75rem, env(safe-area-inset-top, 0px)) !important;
    left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px)) !important;
    right: auto !important;
    width: min(20rem, calc(100vw - 1.5rem)) !important;
    max-width: 20rem !important;
    height: auto !important;
    max-height: calc(
      100dvh - 1.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
    ) !important;
    margin: 0 !important;
    z-index: 10300 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 1rem 1rem 1.1rem !important;
    border: 1px solid color-mix(in srgb, var(--ducky-color-border, #333) 80%, transparent) !important;
    border-radius: 1.15rem !important;
    background: color-mix(in srgb, var(--ducky-color-bg, #0a0a0a) 94%, #000) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    animation: udh-drawer-slide-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open.udh-drawer-closing {
    pointer-events: none !important;
    animation: udh-drawer-slide-out 0.26s cubic-bezier(0.4, 0, 1, 1) both !important;
  }

  .site-mobile-overlay.open {
    animation: udh-scrim-in 0.26s ease both !important;
  }

  body.udh-drawer-closing .site-mobile-overlay {
    display: block !important;
    pointer-events: none !important;
    animation: udh-scrim-out 0.26s ease both !important;
  }

  @media (prefers-reduced-motion: reduce) {
    html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open,
    html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open.udh-drawer-closing,
    .site-mobile-overlay.open,
    body.udh-drawer-closing .site-mobile-overlay {
      animation-duration: 0.01ms !important;
    }

    #app-header .site-nav-mobile-toggle::before,
    #app-header .site-nav-mobile-toggle::after {
      transition-duration: 0.01ms !important;
      transition-delay: 0s !important;
    }
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"] .site-nav-link--external::after,
  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"] a.site-nav-link.site-nav-link--external::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-foot {
    margin-top: auto !important;
    padding: 0.85rem 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 0 0.1rem !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-user {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    margin: 0 !important;
    padding: 1rem 1rem 1.05rem !important;
    border: 1px solid color-mix(in srgb, var(--ducky-color-border, #333) 65%, transparent) !important;
    border-radius: 1rem !important;
    background: color-mix(in srgb, var(--ducky-color-surface, #181818) 92%, #000) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-user__row {
    gap: 0.75rem !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-user__links {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    padding-top: 0.15rem !important;
    align-items: stretch !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-user__links a,
  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-user__links button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0.55rem 0.65rem !important;
    border-radius: 0.65rem !important;
    border: 1px solid color-mix(in srgb, var(--ducky-color-border, #333) 55%, transparent) !important;
    background: color-mix(in srgb, var(--ducky-color-bg, #0a0a0a) 55%, transparent) !important;
    color: var(--ducky-color-text, #ededed) !important;
    font-size: 0.82rem !important;
    font-weight: 550 !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-user__links a.is-admin {
    color: var(--ducky-color-accent, #fbb436) !important;
    border-color: color-mix(in srgb, var(--ducky-color-accent, #fbb436) 35%, transparent) !important;
  }

  html body > [data-ducky-mobile-nav-panel][data-udh-drawer="1"].udh-drawer-open .udh-drawer-user__links button.is-danger {
    grid-column: 1 / -1 !important;
    padding: 0.6rem 0.85rem !important;
    border-radius: 999px !important;
    border: 1px solid color-mix(in srgb, var(--ducky-color-border, #333) 70%, transparent) !important;
    background: color-mix(in srgb, var(--ducky-color-bg, #0a0a0a) 80%, #000) !important;
    color: var(--ducky-color-textMuted, #a1a1a1) !important;
    font-weight: 600 !important;
  }
}

/* Footer social row */
#app-footer .ud-foot-social,
.site-footer .ud-foot-social {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.25rem 0 0;
}

#app-footer .ud-foot-social .udh-btn,
.site-footer .ud-foot-social .udh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ducky-color-accent, #fbb436);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

#app-footer .ud-foot-social .udh-btn:hover,
.site-footer .ud-foot-social .udh-btn:hover {
  color: #fff;
  transform: scale(1.06);
}

#app-footer .ud-foot-social .udh-btn svg,
.site-footer .ud-foot-social .udh-btn svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* Header vertical align — keep brand / nav / chips on one midline */
#app-header .zone-container,
#app-header .workspace,
#app-header .grid-content,
#app-header #grid-header {
  min-height: 3.5rem !important;
  align-items: center !important;
}

#app-header .layout-item,
#app-header .layout-item .item-content,
#app-header .layout-item .b-site-block,
#app-header .layout-item .b-site-nav {
  align-self: center !important;
  display: flex !important;
  align-items: center !important;
}

#app-header .site-nav--desktop,
#app-header nav.site-nav.site-nav--desktop {
  align-items: center !important;
  height: 2rem !important;
}

#app-header .site-nav--desktop .site-nav-link {
  align-items: center !important;
  height: 2rem !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 0.875rem !important;
}

#app-header .site-nav--desktop .site-nav-link.active {
  font-size: 0.875rem !important;
  font-weight: 650 !important;
}

#app-header .site-nav--desktop .site-nav-link::after {
  bottom: 0.15rem !important;
}

/* GitHub pill: logo + count (no star glyph). Visible desktop + mobile. */
.udh-btn--github {
  width: auto !important;
  min-width: 0 !important;
  height: 2rem !important;
  padding: 0 !important;
  gap: 0 !important;
  color: var(--ducky-color-accent, #fbb436) !important;
}

.udh-btn--github > svg {
  display: none !important;
}

.udh-btn--github .udh-gh-stat {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  height: 1.7rem;
  padding: 0 0.55rem 0 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ducky-color-accent, #fbb436) 35%, transparent);
  background: color-mix(in srgb, var(--ducky-color-accent, #fbb436) 14%, transparent);
  color: var(--ducky-color-accent, #fbb436);
  line-height: 1;
}

.udh-btn--github .udh-gh-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.udh-btn--github .udh-gh-mark svg {
  display: block !important;
  width: 0.95rem !important;
  height: 0.95rem !important;
}

.udh-btn--github .udh-gh-star {
  display: none !important;
}

.udh-btn--github .udh-stars {
  display: inline-flex !important;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.udh-btn--github:hover .udh-gh-stat {
  border-color: color-mix(in srgb, #fff 40%, transparent);
  background: color-mix(in srgb, #fff 12%, transparent);
  color: #fff;
}

@media (max-width: 52rem) {
  .udh-btn--github .udh-stars,
  .udh-btn--github .udh-gh-stat {
    display: inline-flex !important;
  }

  .udh-btn--github {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
  }
}

#app-footer .ud-foot-social .udh-btn--github,
.site-footer .ud-foot-social .udh-btn--github {
  width: auto;
  min-width: 0;
  padding: 0;
}

#app-footer .ud-foot-social .udh-btn--github > svg,
.site-footer .ud-foot-social .udh-btn--github > svg {
  display: none;
}

#app-footer .ud-foot-social .udh-gh-stat,
.site-footer .ud-foot-social .udh-gh-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 1.7rem;
  padding: 0 0.55rem 0 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ducky-color-accent, #fbb436) 35%, transparent);
  background: color-mix(in srgb, var(--ducky-color-accent, #fbb436) 14%, transparent);
  color: var(--ducky-color-accent, #fbb436);
}

#app-footer .ud-foot-social .udh-gh-mark svg,
.site-footer .ud-foot-social .udh-gh-mark svg {
  width: 0.95rem;
  height: 0.95rem;
}

#app-footer .ud-foot-social .udh-gh-star,
.site-footer .ud-foot-social .udh-gh-star {
  display: none;
}

#app-footer .ud-foot-social .udh-stars,
.site-footer .ud-foot-social .udh-stars {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}


/* Footer About Me (menu) — centered, not in header */
#app-footer .ud-foot-links,
.site-footer .ud-foot-links,
#app-footer .layout-item[data-id="about-link"],
.site-footer .layout-item[data-id="about-link"] {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0.15rem 0 0.65rem !important;
}

#app-footer .ud-foot-links .site-nav,
#app-footer .ud-foot-links nav,
#app-footer .layout-item[data-id="about-link"] .site-nav,
#app-footer .layout-item[data-id="about-link"] nav,
.site-footer .ud-foot-links .site-nav,
.site-footer .layout-item[data-id="about-link"] .site-nav {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1rem !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#app-footer .ud-foot-links a,
#app-footer .layout-item[data-id="about-link"] a,
.site-footer .ud-foot-links a,
.site-footer .layout-item[data-id="about-link"] a {
  color: var(--ducky-color-textMuted, #a1a1a1) !important;
  text-decoration: none !important;
  font-size: 0.9rem !important;
  font-weight: 550 !important;
}

#app-footer .ud-foot-links a:hover,
#app-footer .layout-item[data-id="about-link"] a:hover,
.site-footer .ud-foot-links a:hover,
.site-footer .layout-item[data-id="about-link"] a:hover {
  color: var(--ducky-color-accent, #fbb436) !important;
}

/* Kill leftover star glyph next to GitHub count */
.udh-btn--github .udh-gh-star,
.udh-btn--github svg.udh-gh-star,
#app-footer .ud-foot-social .udh-gh-star,
.site-footer .ud-foot-social .udh-gh-star {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}
